Skip to contentSkip to conversation

devconfig: firstconfig enhancements

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

lore
Share & tools
lore
#0 lore raw

v2 cover devconfig: firstconfig enhancements

A few enhancements to for CIs. This v2 adds a fix for an issue reported by Chuck.

Luis Chamberlain (2):
devconfig: localize unnattended-upgrades sanity check
devconfig: enhance firstconfig on debian

 playbooks/roles/devconfig/defaults/main.yml   |  1 +
 .../tasks/install-deps/debian/main.yml        | 29 ++++++++++++++++++-
 2 files changed, 29 insertions(+), 1 deletion(-)
Signature · 1 line
2.47.2
#1 lore raw

PATCH v2 1/2 devconfig: localize unnattended-upgrades sanity check

Commit 4680fce19494e ("devconfig: ensure unattended-upgrades is not installed on debian") was a bit too broad. We want this check only for guestfs setups.

Fixes 4680fce19494e ("devconfig: ensure unattended-upgrades is not installed on debian")
---
 playbooks/roles/devconfig/defaults/main.yml                  | 1 +
 playbooks/roles/devconfig/tasks/install-deps/debian/main.yml | 3 +++
 2 files changed, 4 insertions(+)
playbooks/roles/devconfig/defaults/main.yml +1 -0
index 66e78490ab31..2584eb843786 100644
@@ -54,5 +54,6 @@ devconfig_enable_systemd_timesyncd_ntp: False
 devconfig_enable_systemd_timesyncd_ntp_google: False
 devconfig_enable_systemd_timesyncd_ntp_debian: False
 devconfig_enable_systemd_timesyncd_ntp_google_debian: False
+kdevops_enable_guestfs: False
 guestfs_copy_sources_from_host_to_guest: False
 distro_debian_has_hop1_sources: False
playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +3 -0
index 954f0aede3b2..8efc59bc167f 100644
@@ -8,6 +8,8 @@
 - name: Set fact if unattended-upgrades is installed
   set_fact:
     unattended_upgrades_installed: "{{ 'install ok installed' in unattended_upgrade_status.stdout }}"
+  when:
+    - kdevops_enable_guestfs|bool
 
 - name: Verify unattended-upgrades is not installed
   fail:
@@ -19,6 +21,7 @@
       make cleancache
       make bringup
   when:
+    - kdevops_enable_guestfs|bool
     - unattended_upgrades_installed|bool
 
 - name: Upgrade Packages
Signature · 1 line
2.47.2
#2 lore raw

PATCH v2 2/2 devconfig: enhance firstconfig on debian

In reply to 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 +25 -1
index 8efc59bc167f..6ffe00fef3a5 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:
@@ -23,6 +24,26 @@
   when:
     - kdevops_enable_guestfs|bool
     - 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
@@ -37,7 +58,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
@@ -48,6 +69,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
@@ -62,6 +84,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
@@ -80,6 +103,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
Reviewed-by on the v2 series
#3 lore raw
In reply to Luis Chamberlain
Quoted 11 lines · Luis Chamberlain

A few enhancements to for CIs. This v2 adds a fix for an issue reported by Chuck.

Luis Chamberlain (2):
devconfig: localize unnattended-upgrades sanity check
devconfig: enhance firstconfig on debian

 playbooks/roles/devconfig/defaults/main.yml   |  1 +
 .../tasks/install-deps/debian/main.yml        | 29 ++++++++++++++++++-
 2 files changed, 29 insertions(+), 1 deletion(-)

And at some point soon I will try to wheel that into my cloud environments to try it out with their Debian flavors.

Signature · 1 line
Chuck Lever
#4 lore raw
Quoted 13 lines · Chuck Lever
Quoted 11 lines · Luis Chamberlain

A few enhancements to for CIs. This v2 adds a fix for an issue reported by Chuck.

Luis Chamberlain (2):
devconfig: localize unnattended-upgrades sanity check
devconfig: enhance firstconfig on debian

 playbooks/roles/devconfig/defaults/main.yml   |  1 +
 .../tasks/install-deps/debian/main.yml        | 29 ++++++++++++++++++-
 2 files changed, 29 insertions(+), 1 deletion(-)
Quoted 4 lines

And at some point soon I will try to wheel that into my cloud environments to try it out with their Debian flavors.

Thanks pushed.

Luis