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

60 lines
1.6 KiB
YAML

---
# Management of packages
- name: Activate LTS support by the means of HWE stack
apt:
name:
- linux-generic-lts-xenial
- xserver-xorg-core-lts-xenial
- xserver-xorg-lts-xenial
- xserver-xorg-video-all-lts-xenial
- xserver-xorg-input-all-lts-xenial
- libwayland-egl1-mesa-lts-xenial
state: present
install_recommends: yes
- name: Removing packages commonly not required
apt:
pkg: "{{ base_common_delpkg }}"
state: absent
purge: yes
- name: Removing packages from client machines
apt:
pkg: "{{ base_client_delpkg }}"
state: absent
purge: yes
when: ansible_local.noderole.role == 'client' and base_client_delpkg|length > 0
- name: Removing packages from docenti machines
apt:
pkg: "{{ base_docenti_delpkg }}"
state: absent
purge: yes
when: ansible_local.noderole.role == 'docenti' and base_docenti_delpkg|length > 0
- name: Cleanup of unneeded packages
shell: apt-get -y autoremove
args:
warn: false
register: autoremove
changed_when: "'Rimozione' in autoremove.stdout"
- name: Installing additional common packages
apt:
pkg: "{{ base_common_addpkg }}"
state: present
tags: edu-install
- name: Installing additional packages for client role
apt:
pkg: "{{ base_client_addpkg }}"
state: present
when: ansible_local.noderole.role == 'client' and base_client_addpkg|length > 0
- name: Installing additional packages for docenti role
apt:
pkg: "{{ base_docenti_addpkg }}"
state: present
when: ansible_local.noderole.role == 'docenti' and base_docenti_addpkg|length > 0