ansible: Force dpkg configuration during release upgrades
authorKienan Stewart <kstewart@efficios.com>
Fri, 16 Jun 2023 18:20:48 +0000 (14:20 -0400)
committerKienan Stewart <kstewart@efficios.com>
Tue, 20 Jun 2023 15:18:55 +0000 (11:18 -0400)
This stops the installer from prompting for user decisions during the
various upgrades. Using confnew instead of confold risks breaking
configuration, but we largely use default configurations choosing the
new one means we don't have to go over all the diffs manually.

Change-Id: I754ec43fa35e23050659961ccbadf404ed7838cc

automation/ansible/playbooks/release-upgrade.yml
automation/ansible/tasks/debian_release_upgrade.yml

index fcc2d70c025835b5163b60ce894511ff3ef34477..d1c724b24b4a4d5044073d244e1c1b867c35b4d8 100644 (file)
@@ -91,6 +91,7 @@
     apt_noninteractive_environment:
       DEBIAN_FRONTEND: noninteractive
       APT_LISTCHANGES_FRONTEND: mail
+    apt_common_options: "-o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confnew'"
   tasks:
     - import_tasks: ../tasks/debian_release_upgrade.yml
       when: ansible_distribution == 'Debian'
index 3d9f6bb4eb6cd0af2d94f1176bfea5d934abb580..190d3be185922cb56d3e019d5572d469e67d052a 100644 (file)
 # @TODO: Check required disk space and available disk space
 - name: Download packages
   command:
-    cmd: 'apt-get -y -d upgrade'
+    cmd: 'apt-get -y -d upgrade {{apt_common_options}}'
     warn: false
   environment: "{{apt_noninteractive_environment}}"
 - name: Minimal upgrade run
   command:
-    cmd: 'apt upgrade -y --without-new-pkgs'
+    cmd: 'apt upgrade -y --without-new-pkgs {{apt_common_options}}'
     warn: false
   environment: "{{apt_noninteractive_environment}}"
 - name: Full upgrade run
   command:
-    cmd: 'apt full-upgrade -y'
+    cmd: 'apt full-upgrade -y {{apt_common_options}}'
     warn: false
   environment: "{{apt_noninteractive_environment}}"
 # @TODO: reconfigure grub if installed
This page took 0.023861 seconds and 4 git commands to generate.