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