Configure unattended-upgrades

Signed-off-by: Emmy D'Anello <ynerant@emy.lu>
This commit is contained in:
2023-04-03 13:38:26 +02:00
parent 0d560218e2
commit d320cc0a44
7 changed files with 237 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
---
# Install apt-listchanges
- name: Install apt-listchanges
when: ansible_os_family == "Debian"
apt:
name: apt-listchanges
state: present
update_cache: true
register: apt_result
retries: 3
until: apt_result is succeeded
# Send email when there is something new
- name: Configure apt-listchanges
ini_file:
path: /etc/apt/listchanges.conf
no_extra_spaces: true
section: apt
option: "{{ item.option }}"
value: "{{ item.value }}"
state: present
mode: 0644
loop:
- option: confirm
value: "true"
- option: email_address
value: "{{ apt.monitoring_mail }}"
- option: which
value: both
...