I spun up an instance of Ubuntu 10.10 in EC2 tonight and installed puppet, for the purpose of testing mongodb. Ubuntu ships with Puppet 2.6.1 To do this I have a recipe which: Installs the official mongodb repo: exec { "mongodb_repo": command => "echo deb http://downloads.mongodb.org/distros/ubuntu 10.4 10gen > /etc/apt/sources.list.d/mondodb.list && apt-key adv -- keyserver keyserver.ubuntu.com --recv 7F0CEB10 && apt-get update", creates => "/etc/apt/sources.list.d/mondodb.list", } Then installs a specific version: package { mongodb-stable: ensure => "20110131" } Unfortunately this results in the following error: err: //Packages::Mongodb/Package[mongodb-stable]/ensure: change from purged to 20110131 failed: Could not update: Execution of ''/usr/bin/ aptitude -y -o DPkg::Options::=--force-confold --force-yes install mongodb-stable=20110131'' returned 1: /usr/bin/aptitude: unrecognized option ''--force-yes'' I believe this is caused by the following code in /usr/lib/ruby/1.8/ puppet/provider/package/apt.rb: 60 str = @resource[:name] 61 case should 62 when true, false, Symbol 63 # pass 64 else 65 # Add the package version and --force-yes option 66 str += "=#{should}" 67 cmd << "--force-yes" 68 end So in this case, when the version was specified, it broke aptitude. On the command line, quoting the switches line this works: -o DPkg::Options::="--force-confold --force-yes" However adding the quotes like this to apt.rb didn''t seem to do the trick. I couldn''t find any similar reported bugs. Has anyone else seen this before? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Felix Frank
2011-Mar-01 16:04 UTC
Re: [Puppet Users] Possible bug with apt and --force-yes
> err: //Packages::Mongodb/Package[mongodb-stable]/ensure: change from > purged to 20110131 failed: Could not update: Execution of ''/usr/bin/ > aptitude -y -o DPkg::Options::=--force-confold --force-yes install > mongodb-stable=20110131'' returned 1: /usr/bin/aptitude: unrecognized > option ''--force-yes''Hi, I''m not sure why your puppet is using the aptitude provider, but you may have better luck specifying provider => "apt" in your package resource. HTH, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Daniel Pittman
2011-Mar-11 03:00 UTC
Re: [Puppet Users] Possible bug with apt and --force-yes
On Wed, Feb 23, 2011 at 00:51, Avleen Vig <avleen@gmail.com> wrote:> I spun up an instance of Ubuntu 10.10 in EC2 tonight and installed > puppet, for the purpose of testing mongodb. Ubuntu ships with Puppet > 2.6.1[…]> I believe this is caused by the following code in /usr/lib/ruby/1.8/ > puppet/provider/package/apt.rb: > 60 str = @resource[:name] > 61 case should > 62 when true, false, Symbol > 63 # pass > 64 else > 65 # Add the package version and --force-yes option > 66 str += "=#{should}" > 67 cmd << "--force-yes" > 68 end > > So in this case, when the version was specified, it broke aptitude. > On the command line, quoting the switches line this works: > -o DPkg::Options::="--force-confold --force-yes" > However adding the quotes like this to apt.rb didn''t seem to do the > trick. > > I couldn''t find any similar reported bugs. Has anyone else seen this > before?I don''t recall seeing it, but I have a horrible feeling I know where things are going sour in there. Anyway, it looks to be a genuine bug, so please report it into RedMine for us. Thanks for doing such good analysis of where the problem wound up, too. Regards, Daniel -- ⎋ Puppet Labs Developer – http://puppetlabs.com ✉ Daniel Pittman <daniel@puppetlabs.com> ✆ Contact me via gtalk, email, or phone: +1 (877) 575-9775 ♲ Made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.