(maint) Add release_checks_7 config to provision.yaml
[puppet-modules/puppetlabs-apt.git] / tasks / init.rb
index d256468b64a739fdaa6446f49b1d5069bc46891d..3cd20d49736f7017d601744e233b245db296cdf3 100755 (executable)
@@ -5,7 +5,7 @@ require 'puppet'
 
 def apt_get(action)
   cmd = ['apt-get', action]
-  cmd << ' -y' if action == 'upgrade'
+  cmd << '-y' if ['upgrade', 'dist-upgrade', 'autoremove'].include?(action)
   stdout, stderr, status = Open3.capture3(*cmd)
   raise Puppet::Error, stderr if status != 0
   { status: stdout.strip }