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

64 lines
1.7 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: '{{ 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