Ask Your Question

puppet noop -- persistance

asked 2016-12-20 20:31:27 -0600

bess gravatar image


What is the recommended method in putting nodes in noop mode?

My goal is to ensure certain groups of nodes are in noop mode so changes don't mistakenly get applied but I want to know if changes 'would' have been applied or if a node has drifted out of CM.

I could edit puppet.conf manually but that does not scale.

I could use Puppet to manage puppet.conf but if a node is in noop mode a new catalog will not be applied to take it out of noop mode or do an enforcing run to put a node back in conformance.

I could use MCollective and use the --noop and no-noop switches.

I cannot seem to find much material for this use case.




edit retag flag offensive close merge delete


Y wouldn't you want your nodes to have the latest configuration? I mean, for servers you could distribute a `puppet.conf` having `noop = true`. So `puppet-agent` usually runs in no-op-mode. Once u verified the changes, you'd manually invoke `puppet agent --test --verbose --no-noop` applying changes.

Kai Burghardt gravatar imageKai Burghardt ( 2016-12-20 21:47:12 -0600 )edit

2 Answers

Sort by » oldest newest most voted

answered 2017-01-17 19:16:06 -0600

Josh gravatar image

Puppet can take an agent back out of noop. When noop is specified from the cmdline or in puppet.conf it just sets the default value of the noop metaparameter. I made a very basic module that can switch an agent in or out of noop mode, have a look at 'agent_noop' on the forge.

edit flag offensive delete link more


Awesome. Ill take a look at your module. So the puppetlabs inifile module can be executed on a node in noop?

bess gravatar imagebess ( 2017-01-21 15:37:02 -0600 )edit

*Any* resource can be enforced when a node is running in noop if you set noop => false on the resource. Simple example: # puppet apply --noop -e 'file { "/tmp/foo": ensure => file, noop => false}' Notice: /Stage[main]/Main/File[/tmp/foo]/ensure: created

Josh gravatar imageJosh ( 2017-01-23 01:37:46 -0600 )edit

answered 2016-12-21 15:32:07 -0600

Making assumptions about the version of puppet you're running, this will work if you want a one-liner. I've put this in motd sometimes to encourage end users' better angels:

puppet config set noop true

Also puppetlabs/inifile is probably the best way to manage this setting in puppet.

Regardless of how you do this, please note that puppet can't undo it for obvious reasons. You'll need to use mcollective, run a script, etc. to take them out of noop mode.

edit flag offensive delete link more


Well, stages? Introduce a new stage, Have a stage in `noop` mode, while the other one, which manages the puppet.conf, remains in operation. Certainly not the best, but I still can't grasp, why you wouldn't want the latest configuration applied on your nodes. That's why you do all the PP business.

Kai Burghardt gravatar imageKai Burghardt ( 2016-12-21 15:41:31 -0600 )edit

Thanks. Im considering the following: 1) Register new node 2) classify it 3) run puppet in enforcing mode 4) Use MCollective to put the node(s) into noop mode mco shell run 'puppet config set --section agent noop true' -I $FQDN This is using the MCollective Shell plugin by Puppetlabs.

bess gravatar imagebess ( 2016-12-21 16:02:19 -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



Asked: 2016-12-20 20:31:27 -0600

Seen: 542 times

Last updated: Dec 21 '16