Update pdk-templates for gitpod and codespaces support
[puppet-modules/puppetlabs-apt.git] / tasks / init.rb
index ebcf72adddee590f91516a756b07aadeccb16857..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 }