diff options
Diffstat (limited to 'salt/openbook/ansible/files/ansible.yaml')
| -rw-r--r-- | salt/openbook/ansible/files/ansible.yaml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/salt/openbook/ansible/files/ansible.yaml b/salt/openbook/ansible/files/ansible.yaml new file mode 100644 index 0000000..eff4a06 --- /dev/null +++ b/salt/openbook/ansible/files/ansible.yaml @@ -0,0 +1,47 @@ +--- +- name: "Install ansible" + hosts: target + tasks: + - 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/{% raw %}{{ item.src }}{% endraw %}" + dest: "{% raw %}{{ item.dest }}{% endraw %}" + mode: "{% raw %}{{ item.mode }}{% endraw %}" + owner: root + group: root + with_items: + - { src: ansible.cfg, dest: /root/ansible/ansible.cfg, mode: "0644" } |
