FAQ
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.

Search Discussions

  • Andy Coates at Aug 24, 2013 at 5:38 am
    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 at Aug 31, 2013 at 4:36 pm
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedAug 20, '13 at 5:05p
activeAug 31, '13 at 4:36p
posts3
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase