client-pull-installation/roles/base/tasks/packages.yml

62 lines
1.6 KiB
YAML

---
# Management of packages
- name: Removing packages commonly not required
apt:
pkg: '{{ item }}'
state: absent
purge: yes
with_items: "{{ base_common_delpkg }}"
- name: Removing packages from client machines
apt:
pkg: '{{ item }}'
state: absent
purge: yes
with_items: "{{ base_client_delpkg }}"
when: ansible_local.noderole.role == 'client' and base_client_delpkg|length > 0
- name: Removing packages from docenti machines
apt:
pkg: '{{ item }}'
state: absent
purge: yes
with_items: "{{ base_docenti_delpkg }}"
when: ansible_local.noderole.role == 'docenti' and base_docenti_delpkg|length > 0
- name: Cleanup of unneeded packages
shell: apt-get -y autoremove
register: autoremove
changed_when: "'Rimozione' in autoremove.stdout"
- name: Installing additional common packages
apt:
pkg: '{{ item }}'
state: installed
with_items: "{{ base_common_addpkg }}"
tags: edu-install
- name: Installing additional packages for client role
apt:
pkg: '{{ item }}'
state: present
with_items: "{{ base_client_addpkg }}"
when: ansible_local.noderole.role == 'client' and base_client_addpkg|length > 0
- name: Installing additional packages for docenti role
apt:
pkg: '{{ item }}'
state: present
with_items: "{{ base_docenti_addpkg }}"
when: ansible_local.noderole.role == 'docenti' and base_docenti_addpkg|length > 0
- name: Correggo NetworkManager per gestire la rete
lineinfile:
dest: /etc/network/interfaces
regexp: "{{ item }}"
state: absent
when: ansible_product_name != "VirtualBox"
with_items:
- ^auto eth0
- ^iface eth0