2023-03-10 18:54:35 +00:00
|
|
|
---
|
|
|
|
# task/main file for manage_apt_packages
|
|
|
|
- name: "Update apt caches"
|
|
|
|
ansible.builtin.apt:
|
|
|
|
update_cache: yes
|
|
|
|
cache_valid_time: 3600
|
|
|
|
|
2023-03-16 22:44:29 +00:00
|
|
|
- name: "Install/remove required apt packages"
|
2023-03-10 18:54:35 +00:00
|
|
|
ansible.builtin.apt:
|
|
|
|
name: "{{ item.name }}{% if item.version not in [None, '', 'latest'] %}={{ item.version }}{% endif %}"
|
|
|
|
state: "{{ item.state }}"
|
2023-03-15 22:06:23 +00:00
|
|
|
allow_downgrade: true
|
2023-03-10 18:54:35 +00:00
|
|
|
loop: "{{ manage_apt_packages_list }}"
|
|
|
|
when: manage_apt_packages_list is defined
|
|
|
|
and manage_apt_packages_list not in [None, '']
|
|
|
|
notify: "apt-autoremove"
|