On Sunday 22 December 2013 at 02:39, Felix Frank wrote:
On 12/20/2013 04:58 PM, Jon Yeargers wrote:
The main reason I'm asking is that the 'apt-get update' seems to always
run last in the 'agent' pass. IE it takes two runs to get the latest
packages - 1 to update the cache and the 2nd to get the latest versions.
Please note that Puppet won’t trigger the actions immediately for Execs and
Services which should only get ‘refreshed’ when once notified.
As Felix wrote, this is by design, because there could be more resources
in the catalog which would also trigger a refresh (eg. you don’t want to
restart Apache for every new vhost added during a run).
I guess your problem here is, that you want to install a package from a
different repository than the default operating system repo?
Puppet will typically create the repository configuration, and will then
install the package from the wrong repository, because apt-get update
wasn’t run yet.
What you would basically want to do, is to tie the APT configuration and
running the apt-get update together and put it in order, so this is run
before any package is installed.
Puppetlabs APT module, is a nice example on how you can write such
contained modules with ‘anchoring’ (from puppetlabs-stdlib):
There’s also a section in the Puppet guide about contained resources:
If I’m right then you will basically want to:
* use the puppetlabs-apt module or something equivalent
* define an apt::source with the repository you would like to add
* Tell Puppet to run apt-get update before the installation of any package:
Exec[‘apt_update'] -> Package <| |>
But sharing code examples or a bit more information would be helpful.
Regards, Stefan.
--
Stefan Schlesinger ////////////////////////////////////////// ///////