I'm using puppet to maintain a growing pile of debian machines. These will be maintained from their initialization onwards. This means that one step will be setting the apt 'sources.list' file and then updating it.

There are other modules that rely on this list being up to date and will fail if apt-get update hasn't been called. What I'm wondering is should I introduce some sort of ordering process (using stages or similar) to ensure that the package list is updated before attempting to install apps or just assume that it will likely fail on the first run but work on subsequent runs once the list is updated?

The ethos of puppet seems to be declaring a 'final state' rather than a process. This leads me to believe that letting the errors occur is probably the way to go.


You can use an exec resource with refreshonly => true that gets notified when the sources.list file changes. And have the class containing both the file management resource and the exec resource be a require from the package resources that need them.

The way I'd recommend approaching this in a simpler way would be to manage the sources through the apt::source resource type in the apt module from Puppet Labs, which handles the update as well.

  • I've just started adding items from puppet forge. I've been wanting to learn the process of defining my own modules but some (like this) are a slam dunk. Thank you. – ethrbunny Aug 31 '13 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.