Skip to content

Commit bb7eb5c

Browse files
Merge pull request #999 from smortex/debian-frontend
(maint) Set DEBIAN_FRONTEND=noninteractive on upgrade
2 parents 7d495c5 + 287daf9 commit bb7eb5c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tasks/init.rb

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
def apt_get(action)
99
cmd = ['apt-get', action]
1010
cmd << '-y' if ['upgrade', 'dist-upgrade', 'autoremove'].include?(action)
11+
if ['upgrade', 'dist-upgrade'].include?(action)
12+
ENV['DEBIAN_FRONTEND'] = 'noninteractive'
13+
cmd << '-o'
14+
cmd << 'Dpkg::Options="--force-confdef"'
15+
cmd << '-o'
16+
cmd << 'Dpkg::Options="--force-confold"'
17+
end
1118
stdout, stderr, status = Open3.capture3(*cmd)
1219
raise Puppet::Error, stderr if status != 0
1320
{ status: stdout.strip }

0 commit comments

Comments
 (0)