ansible: Allow unattended upgrades from Debian backports
authorKienan Stewart <kstewart@efficios.com>
Thu, 26 Sep 2024 13:25:55 +0000 (09:25 -0400)
committerKienan Stewart <kstewart@efficios.com>
Thu, 26 Sep 2024 13:25:55 +0000 (09:25 -0400)
Change-Id: Ia201cb63c660ab2b11757647af363de83d66043c
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
automation/ansible/roles/incus/tasks/install.yml

index aafcd8a9b467cec29030aa1ce381d7bd6d1c3e74..8889f0fadfb8e25fe1b6618943812236aa53e3e2 100644 (file)
@@ -2,8 +2,17 @@
 
 - name: Configure bookworm-backports
   when: ansible_distribution == 'Debian' and ansible_distribution_major_version == '12'
-  ansible.builtin.apt_repository:
-    repo: 'deb https://deb.debian.org/debian bookworm-backports main contrib non-free-firmware'
+  block:
+    - ansible.builtin.apt_repository:
+        repo: 'deb https://deb.debian.org/debian bookworm-backports main contrib non-free-firmware'
+    - ansible.builtin.copy:
+        content: "Unattended-Upgrade::Origins-Pattern:: \"origin=Debian Backports,codename=${distro_codename}-backports,label=Debian Backports\";\n"
+        dest: '/etc/apt/apt.conf.d/90unattended_upgrades-backports.conf'
+        owner: 'root'
+        group: 'root'
+        mode: '0644'
+      notify:
+        - 'apt update'
 
 - name: Install packages
   ansible.builtin.package:
This page took 0.024108 seconds and 4 git commands to generate.