unattended_upgrades: apt-listchanges sends no mails
This commit is contained in:
@@ -23,6 +23,21 @@
|
|||||||
dest: /etc/apt/apt.conf.d/52unattended-upgrades-local
|
dest: /etc/apt/apt.conf.d/52unattended-upgrades-local
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
|
||||||
|
# Debian installs apt-listchanges with email_address=root, which mails the NEWS of every
|
||||||
|
# unattended upgrade through the mail relay.
|
||||||
|
- name: Check for the apt-listchanges config
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: /etc/apt/listchanges.conf
|
||||||
|
register: unattended_upgrades_listchanges
|
||||||
|
|
||||||
|
- name: Disable the apt-listchanges mails
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: /etc/apt/listchanges.conf
|
||||||
|
regexp: '^email_address='
|
||||||
|
line: email_address=none
|
||||||
|
insertafter: '^\[apt\]'
|
||||||
|
when: unattended_upgrades_listchanges.stat.exists
|
||||||
|
|
||||||
- name: Enable the apt timers
|
- name: Enable the apt timers
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user