From 97f697047dbd951a0b0f98dfea587f091464c68c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Romain=20Tarti=C3=A8re?= Date: Tue, 24 Aug 2021 15:22:51 -1000 Subject: [PATCH] (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. --- tasks/init.rb | 1 + 1 file changed, 1 insertion(+) 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 } -- 2.45.2