From: Kienan Stewart Date: Fri, 16 Jun 2023 18:20:48 +0000 (-0400) Subject: ansible: Force dpkg configuration during release upgrades X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7033367ae2fd2ea02f3920cef09f794b4986ff2b;p=lttng-ci.git ansible: Force dpkg configuration during release upgrades 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 --- diff --git a/automation/ansible/playbooks/release-upgrade.yml b/automation/ansible/playbooks/release-upgrade.yml index fcc2d70..d1c724b 100644 --- a/automation/ansible/playbooks/release-upgrade.yml +++ b/automation/ansible/playbooks/release-upgrade.yml @@ -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' diff --git a/automation/ansible/tasks/debian_release_upgrade.yml b/automation/ansible/tasks/debian_release_upgrade.yml index 3d9f6bb..190d3be 100644 --- a/automation/ansible/tasks/debian_release_upgrade.yml +++ b/automation/ansible/tasks/debian_release_upgrade.yml @@ -27,17 +27,17 @@ # @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