templier-ansible/roles/apt/tasks/apt-unattended.yml
Emmy D'Anello d320cc0a44
Configure unattended-upgrades
Signed-off-by: Emmy D'Anello <ynerant@emy.lu>
2023-04-03 14:38:43 +02:00

21 lines
457 B
YAML

---
- name: Install unattended-upgrades
when: ansible_os_family == "Debian"
apt:
name: unattended-upgrades
state: present
update_cache: true
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Configure unattended-upgrades
template:
src: "apt/apt.conf.d/{{ item }}.j2"
dest: "/etc/apt/apt.conf.d/{{ item }}"
owner: root
mode: u=rw,g=r,o=r
loop:
- 50unattended-upgrades
- 20auto-upgrades