Ask Your Question

do once vs do always: manifest definitions

asked 2013-07-25 10:04:57 -0600

ethrbunny gravatar image

I'm hoping to setup puppet to manage a slew (>1K) of debian machines that we're about to distribute across the country. Each comes with a basic OS install and needs quite a bit of updating to run our software. Puppet seems like a perfect fit.

What I'm wondering: how do I create my manifest(s) such that it's divided between the do once and do always tasks?

  • do once: setting the time zone, dist-upgrade
  • do always: (IE every time the agent runs) check that certain services are live and up to date, new config changes - standard ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-07-25 12:01:59 -0600

lavaman gravatar image

The point of puppet is to describe the desired state and to let puppet enforce that state.

For things like a dist-upgrade, I would keep that in your provisioning process and not in puppet.

The timezone is something you always want to ensure is set to the appropriate value, so having puppet check that every run is reasonable.

Don't try to characterize it as "do once" and "do always" think of it as "provisioning" and "configuration management". Even if it's appropriate to do something as part of the provisioning process, it may still be useful to have puppet ... (more)

edit flag offensive delete link more


Echoing lavaman's response, have a look at the concept of idempotency in Puppet: Always think about the final state that you ...(more)

GregLarkin gravatar imageGregLarkin ( 2013-07-25 14:08:42 -0600 )edit

Got it. So the 'do *only* once' sorts of things should be outside of puppet?

ethrbunny gravatar imageethrbunny ( 2013-07-25 16:45:26 -0600 )edit

Not necessarily. It's fairly common in puppet to have resources that only get applied once using refreshonly, unless, onlyif, and creates. It depends on whether the things that effectively ...(more)

lavaman gravatar imagelavaman ( 2013-07-25 17:07:29 -0600 )edit

For instance, in our provisioning process, literally the only thing that happens (besides disks, etc.) is a dist-upgrade, installing puppetlabs repos, and installing puppet. We do *everything* else to configure ...(more)

lavaman gravatar imagelavaman ( 2013-07-25 17:11:06 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-07-25 10:04:57 -0600

Seen: 178 times

Last updated: Jul 25 '13