Code Review
/
puppet-modules
/
puppetlabs-apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Release prep v9.1.0
[puppet-modules/puppetlabs-apt.git]
/
tasks
/
init.rb
diff --git
a/tasks/init.rb
b/tasks/init.rb
index 43053128a25dbd1edad4a4f041424df26c17f338..ee141cdb691dcc8dd5513b50f3cabb8f0dbffdd1 100755
(executable)
--- a/
tasks/init.rb
+++ b/
tasks/init.rb
@@
-8,12
+8,20
@@
require 'puppet'
def apt_get(action)
cmd = ['apt-get', action]
cmd << '-y' if ['upgrade', 'dist-upgrade', 'autoremove'].include?(action)
def apt_get(action)
cmd = ['apt-get', action]
cmd << '-y' if ['upgrade', 'dist-upgrade', 'autoremove'].include?(action)
+ if ['upgrade', 'dist-upgrade'].include?(action)
+ ENV['DEBIAN_FRONTEND'] = 'noninteractive'
+ cmd << '-o'
+ cmd << 'Dpkg::Options="--force-confdef"'
+ cmd << '-o'
+ cmd << 'Dpkg::Options="--force-confold"'
+ end
stdout, stderr, status = Open3.capture3(*cmd)
raise Puppet::Error, stderr if status != 0
stdout, stderr, status = Open3.capture3(*cmd)
raise Puppet::Error, stderr if status != 0
+
{ status: stdout.strip }
end
{ status: stdout.strip }
end
-params = JSON.parse(
STDIN
.read)
+params = JSON.parse(
$stdin
.read)
action = params['action']
begin
action = params['action']
begin