Skip to contentSkip to conversation

devconfig: enhance firstconfig on debian

PATCH In review Luis Chamberlain 2 participants 3 messages Apr 18, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devconfig: enhance firstconfig on debian

There's a slew of stupid packages we need to disable to make CI more robust and deterministic at bringup. The unattended-upgrades is one of them, the other one is the systemd-networkd-wait-online.service which is just broken on debian trixie in the way we setup networking.

Although there are devconfig tasks already to disable these, its not enough as devconfig playbook may not be run until later, and so we need to do this as early as possible.

---
 .../tasks/install-deps/debian/main.yml        | 26 ++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +25 -1
index 954f0aede3b2..dea648e21465 100644
@@ -4,6 +4,7 @@
   register: unattended_upgrade_status
   ignore_errors: true
   changed_when: false
+  tags: firstconfig
 
 - name: Set fact if unattended-upgrades is installed
   set_fact:
@@ -20,6 +21,26 @@
       make bringup
   when:
     - unattended_upgrades_installed|bool
+  tags: firstconfig
+
+- name: Stop and disable unattended-upgrades related services
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  systemd:
+    name: "{{ item }}"
+    state: stopped
+    enabled: no
+    daemon_reload: yes
+  loop:
+    - unattended-upgrades
+    - apt-daily.service
+    - apt-daily.timer
+    - apt-daily-upgrade.service
+    - apt-daily-upgrade.timer
+    - systemd-networkd-wait-online.service
+  ignore_errors: yes
+  tags: firstconfig
 
 - name: Upgrade Packages
   become: yes
@@ -34,7 +55,7 @@
   delay: 60
   tags: firstconfig
 
-- name: Remove unattended-upgrades package
+- name: Remove unattended-upgrades package in case upgrade installed it
   become: yes
   become_flags: 'su - -c'
   become_method: sudo
@@ -45,6 +66,7 @@
   retries: 20
   delay: 30
   until: removal_result is not failed
+  tags: firstconfig
 
 - name: Remove optional unattended-upgrades configuration files if they exist
   become: yes
@@ -59,6 +81,7 @@
     - /etc/apt/apt.conf.d/50unattended-upgrades
     - /etc/apt/apt.conf.d/52unattended-upgrades-local
   ignore_errors: yes
+  tags: firstconfig
 
 - name: Stop and disable unattended-upgrades related services
   become: yes
@@ -77,6 +100,7 @@
     - apt-daily-upgrade.timer
     - systemd-networkd-wait-online.service
   ignore_errors: yes
+  tags: firstconfig
 
 - name: Allow for distro source change / upgrade
   become: yes
Signature · 1 line
2.47.2
#1 lore raw
Quoted 19 lines · Luis Chamberlain

There's a slew of stupid packages we need to disable to make CI more robust and deterministic at bringup. The unattended-upgrades is one of them, the other one is the systemd-networkd-wait-online.service which is just broken on debian trixie in the way we setup networking.

Although there are devconfig tasks already to disable these, its not enough as devconfig playbook may not be run until later, and so we need to do this as early as possible.

---
 .../tasks/install-deps/debian/main.yml        | 26 ++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +0 -0
index 954f0aede3b2..dea648e21465 100644

playbooks/roles/devconfig/tasks/install-deps/debian/main.yml line 10

Quoted 7 lines
playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +1 -0
@@ -4,6 +4,7 @@
   register: unattended_upgrade_status
   ignore_errors: true
   changed_when: false
+  tags: firstconfig
 
 - name: Set fact if unattended-upgrades is installed
   set_fact:

The patch context leaves out this step:

12 - name: Verify unattended-upgrades is not installed

13 fail:

14 msg: |

15 The unattended-upgrades package is installed on the base
image, this
16 can cause tons of issues with CIs. Fix this by running the
following
17 commands:

18

19 make cleancache

20 make bringup

21 when:

22 - unattended_upgrades_installed|bool

This step will still fail if the cloud OS image has unattended-upgrades installed. Should the proposed patch remove this step (and maybe the one right before it) too?

Quoted 60 lines
playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +24 -1
@@ -20,6 +21,26 @@
       make bringup
   when:
     - unattended_upgrades_installed|bool
+  tags: firstconfig
+
+- name: Stop and disable unattended-upgrades related services
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  systemd:
+    name: "{{ item }}"
+    state: stopped
+    enabled: no
+    daemon_reload: yes
+  loop:
+    - unattended-upgrades
+    - apt-daily.service
+    - apt-daily.timer
+    - apt-daily-upgrade.service
+    - apt-daily-upgrade.timer
+    - systemd-networkd-wait-online.service
+  ignore_errors: yes
+  tags: firstconfig
 
 - name: Upgrade Packages
   become: yes
@@ -34,7 +55,7 @@
   delay: 60
   tags: firstconfig
 
-- name: Remove unattended-upgrades package
+- name: Remove unattended-upgrades package in case upgrade installed it
   become: yes
   become_flags: 'su - -c'
   become_method: sudo
@@ -45,6 +66,7 @@
   retries: 20
   delay: 30
   until: removal_result is not failed
+  tags: firstconfig
 
 - name: Remove optional unattended-upgrades configuration files if they exist
   become: yes
@@ -59,6 +81,7 @@
     - /etc/apt/apt.conf.d/50unattended-upgrades
     - /etc/apt/apt.conf.d/52unattended-upgrades-local
   ignore_errors: yes
+  tags: firstconfig
 
 - name: Stop and disable unattended-upgrades related services
   become: yes
@@ -77,6 +100,7 @@
     - apt-daily-upgrade.timer
     - systemd-networkd-wait-online.service
   ignore_errors: yes
+  tags: firstconfig
 
 - name: Allow for distro source change / upgrade
   become: yes
Signature · 1 line
Chuck Lever
#2 lore raw
Quoted 48 lines · Chuck Lever
Quoted 19 lines · Luis Chamberlain

There's a slew of stupid packages we need to disable to make CI more robust and deterministic at bringup. The unattended-upgrades is one of them, the other one is the systemd-networkd-wait-online.service which is just broken on debian trixie in the way we setup networking.

Although there are devconfig tasks already to disable these, its not enough as devconfig playbook may not be run until later, and so we need to do this as early as possible.

---
 .../tasks/install-deps/debian/main.yml        | 26 ++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +0 -0
index 954f0aede3b2..dea648e21465 100644

playbooks/roles/devconfig/tasks/install-deps/debian/main.yml line 10

Quoted 7 lines
playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +1 -0
@@ -4,6 +4,7 @@
   register: unattended_upgrade_status
   ignore_errors: true
   changed_when: false
+  tags: firstconfig
 
 - name: Set fact if unattended-upgrades is installed
   set_fact:

The patch context leaves out this step:

12 - name: Verify unattended-upgrades is not installed

13 fail:

14 msg: |

15 The unattended-upgrades package is installed on the base
image, this
16 can cause tons of issues with CIs. Fix this by running the
following
17 commands:

18

19 make cleancache

20 make bringup

Quoted 7 lines

21 when:

22 - unattended_upgrades_installed|bool

This step will still fail if the cloud OS image has unattended-upgrades installed. Should the proposed patch remove this step (and maybe the one right before it) too?

Sorry I should make that a guestfs crap thing only. Will send a v2.

Luis