Skip to content

Commit 97f6970

Browse files
committed
(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.
1 parent b5387f1 commit 97f6970

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tasks/init.rb

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
def apt_get(action)
99
cmd = ['apt-get', action]
1010
cmd << '-y' if ['upgrade', 'dist-upgrade', 'autoremove'].include?(action)
11+
ENV['DEBIAN_FRONTEND'] = 'noninteractive' if ['upgrade', 'dist-upgrade'].include?(action)
1112
stdout, stderr, status = Open3.capture3(*cmd)
1213
raise Puppet::Error, stderr if status != 0
1314
{ status: stdout.strip }

0 commit comments

Comments
 (0)