From: Romain Tartière Date: Wed, 25 Aug 2021 01:22:51 +0000 (-1000) Subject: (maint) Set DEBIAN_FRONTEND=noninteractive on upgrade X-Git-Tag: v8.3.0~3^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=97f697047dbd951a0b0f98dfea587f091464c68c;p=puppet-modules%2Fpuppetlabs-apt.git (maint) Set DEBIAN_FRONTEND=noninteractive on upgrade When upgrading Debian packages, the system sometimes what to prompt the user about what action to perform. Since a tasks is supposed to be non-interactive, we should disable such prompts. This help when updating some packages, e.g. postfix. --- diff --git a/tasks/init.rb b/tasks/init.rb index 4305312..237da9b 100755 --- a/tasks/init.rb +++ b/tasks/init.rb @@ -8,6 +8,7 @@ require 'puppet' def apt_get(action) cmd = ['apt-get', action] cmd << '-y' if ['upgrade', 'dist-upgrade', 'autoremove'].include?(action) + ENV['DEBIAN_FRONTEND'] = 'noninteractive' if ['upgrade', 'dist-upgrade'].include?(action) stdout, stderr, status = Open3.capture3(*cmd) raise Puppet::Error, stderr if status != 0 { status: stdout.strip }