diff --git a/ansible.cfg b/ansible.cfg index 62ad5f9..083938c 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,3 +1,3 @@ [defaults] -inventory=hosts +inventory=ansdyninv.py log_path=/var/log/ansible.log diff --git a/hosts b/hosts deleted file mode 100644 index 2302eda..0000000 --- a/hosts +++ /dev/null @@ -1 +0,0 @@ -localhost ansible_connection=local diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index dbe6731..f5c4914 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -7,3 +7,8 @@ tags: - base - edubuntu + +- include: role.yml + tags: + - base + - role diff --git a/roles/base/tasks/role.yml b/roles/base/tasks/role.yml new file mode 100644 index 0000000..7ce2de9 --- /dev/null +++ b/roles/base/tasks/role.yml @@ -0,0 +1,13 @@ +--- +# Role based package installation +- name: Installazione pacchetti da aggiungere per il ruolo + apt: name={{ item }} state=present + sudo: yes + when: "{{ addpkg }}|length > 0" + with_items: "{{ addpkg }}" + +- name: Rimozione pacchetti da rimuovere per il ruolo + apt: name={{ item }} state=absent purge=yes + sudo: yes + when: "{{ delpkg }}|length > 0" + with_items: "{{ delpkg }}"