/
/
/
1---
2- name: Remove unattended-upgrades
3 ansible.builtin.apt:
4 name: unattended-upgrades
5 state: absent
6 purge: true
7 update_cache: false
8 become: true
9
10- name: Disable APT periodic tasks
11 ansible.builtin.copy:
12 dest: /etc/apt/apt.conf.d/20auto-upgrades
13 content: |
14 APT::Periodic::Update-Package-Lists "0";
15 APT::Periodic::Download-Upgradeable-Packages "0";
16 APT::Periodic::AutocleanInterval "0";
17 APT::Periodic::Unattended-Upgrade "0";
18 owner: root
19 group: root
20 mode: "0644"
21 become: true
22
23- name: Stop/disable apt-daily services & timers
24 ansible.builtin.systemd:
25 name: "{{ item }}"
26 state: stopped
27 enabled: false
28 masked: true
29 loop:
30 - apt-daily.service
31 - apt-daily-upgrade.service
32 - apt-daily.timer
33 - apt-daily-upgrade.timer
34 become: true
35
36