diff options
| author | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-11-13 16:50:55 -0700 |
|---|---|---|
| committer | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-11-13 16:50:55 -0700 |
| commit | ffa2a169ea98fb54a29d90ca158059e79e2816ba (patch) | |
| tree | 018461d031b71178fa48b9672d8e39bac4de1270 /playbooks/ansible.yaml | |
initial commit
Diffstat (limited to 'playbooks/ansible.yaml')
| -rw-r--r-- | playbooks/ansible.yaml | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/playbooks/ansible.yaml b/playbooks/ansible.yaml new file mode 100644 index 0000000..94850fc --- /dev/null +++ b/playbooks/ansible.yaml @@ -0,0 +1,52 @@ +--- +- name: "Install ansible" + hosts: target + tasks: + - name: "Add ansible PPA" + apt_repository: + repo: ppa:ansible/ansible + state: present + + - name: "Update apt" + apt: + update_cache: yes + when: ansible_distribution == "Ubuntu" + + - name: "Install ansible package" + apt: + pkg: "{{ item }}" + state: present + with_items: + - ansible + when: ansible_distribution == "Ubuntu" + + - name: "Update yum cache" + yum: + update_cache: yes + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install ansible package" + yum: + name: "{{ item }}" + state: present + with_items: + - ansible + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install ansible package" + portage: + name: "{{ item }}" + state: present + with_items: + - app-admin/ansible + when: ansible_distribution == "Gentoo" + + - name: "Configure ansible" + copy: + src: "../files/{{ item.src }}" + dest: "{{ item.dest }}" + mode: "{{ item.mode }}" + owner: root + group: root + with_items: + - { src: ansible.cfg, dest: /etc/ansible/ansible.cfg, mode: "0644" } |
