Yves Fauser
2013-Aug-20 13:15 UTC
[Puppet Users] How to handle apt-get -f install -y with Puppet
Hi All, I''m trying to install packages using the dpkg provider on Ubuntu that leave the package unconfigured because of missing dependencies. After installing all packages, I need to run "apt-get -f install -y" to fix the dependencies. Now with puppet I did not find a way to do so yet. I''m trying to do the following: ...... package { "mypackage": provider => dpkg, ensure => installed, source => "/tmp/mypkg/mypackage.deb", before => Exec[''apt-get fix''], } exec { "apt-get fix": command => "/usr/bin/apt-get -f install -y", } ...... But dpkg exits with a failure, and therefore the exec of "apt-get -f install -y" is skipped because of failed (puppet) dependencies. Error: /Stage[main]/mymodule::mypkg/Package[mypackage]/ensure: change from absent to present failed: Execution of ''/usr/bin/dpkg --force-confold -i /tmp/mypkg/mypackage.deb'' returned 1: (Reading database ... 84559 files and directories currently installed.) Preparing to replace ..... (using .../mypackage.deb) ... Unpacking replacement mypackage ... dpkg: dependency problems prevent configuration of ....: etc ..... Warning: /Stage[main]/Vswitch::Mypkg/Exec[apt-get fix]: Skipping because of failed dependencies Any ideas on how I can make this work? can I somehow ignore the return code? Is there an great elegant way to work around this? Many thanks! Any help is really appreciated. Yves -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Andy Coates
2013-Aug-24 05:37 UTC
[Puppet Users] Re: How to handle apt-get -f install -y with Puppet
Just come across this post after needing to do the exact same thing. I can get it to run independently by making the exec a require of the package, but then it will always run itself as well and I only want to run this exec after the package (but as you said the package fails due to the dependancies). -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Bryce Catlin
2013-Aug-31 01:51 UTC
[Puppet Users] Re: How to handle apt-get -f install -y with Puppet
I ran into this too, and I think this is working for me: exec { ''apt-get-fix'': command => "/usr/bin/apt-get -f -y install", unless => "/usr/bin/apt-get check", } I''m still testing, but it''s looking good right now. Bryce On Friday, August 23, 2013 10:37:41 PM UTC-7, Andy Coates wrote:> > Just come across this post after needing to do the exact same thing. I > can get it to run independently by making the exec a require of the > package, but then it will always run itself as well and I only want to run > this exec after the package (but as you said the package fails due to the > dependancies). >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Seemingly Similar Threads
- The way Puppet installs things fail
- Could not set present on ensure: Read-only file system
- Puppet fails to install package, whilst it's okay to do manually
- apt-get update running before installing packages - dependency not working
- wyrie/puppet-nagiosql -- anyone have experience with this module?