Ask Your Question

When you use puppet, how do you separate the provisioning and maintenance code?

asked 2017-07-18 09:21:16 -0500

leeand00 gravatar image

So say you're using puppet. Initially you might use the puppet server to set it up with a puppet agent to setup your server (you might, then again you might use images, but I'm using puppet).

Let's say that the initial provisioning goes well and then you decide you need to add some more settings to your server; but you don't want to re-provision it completely; wipe out the database on the system and start from scratch; instead you'd rather add the settings, perhaps remove some old ones, and then restart your daemon (which to be fair, may already be done by puppet)

Do you:

a. Comment out the initial provisioning code before running puppet apply?
b. Set a variable that can used by the code to prevent it from being re-provisioned?

How is this situation properly handled? Because handling it wrong seems likely to lead to disaster (recovery).

edit retag flag offensive close merge delete


Environments. You use environments. However, I never really faced such situation, because I try to stick to Puppet paradigm of defining a state as best as I can. So my machines are usually finished after one or two Puppet-runs (and possibly a reboot).

Kai Burghardt gravatar imageKai Burghardt ( 2017-07-18 09:46:18 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-07-21 09:44:45 -0500

DarylW gravatar image

Puppet is about describing the desired state - so in our case, we had puppet modules for how the agent install should look, and how the puppet server configuration should be done, etc... We would 'puppet apply' the collection of modules to a node to bootstrap it, and then from then on it uses the same desired state to manage it.

One key thing to remember is that puppet only does what you tell it, and you need to make your changes cognizant of the existing set of state of your infrastructure... There are some changes that will work from 'base image' but will fail based on current configuration..

Some of the changes you mention (around databases, etc..) are things that require complex, ordered sets of instructions, typically across multiple machines. Base Opensource puppet is not as good with that, but Puppet Enterprise has the Application Orchestration ( ), I do know that the creator of mcollective is working on a set of plugins to bring 'playbook' like functionality to mcollective, and ease the setup burdeon over at

edit flag offensive delete link more

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: 2017-07-18 09:21:16 -0500

Seen: 76 times

Last updated: Jul 21