Temporarily disabling resources
Sometimes you want to disable a resource for the time being, so that it doesn't interfere with other work. For example, you might want to tweak a configuration file on the server until you have the exact settings you want, before checking it into Puppet. You don't want Puppet to overwrite it with an old version in the meantime, so you can set the noop
metaparameter on the resource:
noop => true,
How to do it…
This example shows you how to use the noop
metaparameter.
Modify your
manifests/nodes.pp
file as follows:node 'cookbook' { file { '/tmp/test.cfg': content => "Hello, world!\n", noop => true, } }
Run Puppet:
ubuntu@cookbook:~/puppet$ papply Notice: /Stage[main]//Node[cookbook]/File[/tmp/test.cfg]/ensure: current_value absent, should be file (noop) Notice: Node[cookbook]: Would have triggered 'refresh' from 1 events Notice: Class[Main]: Would have triggered 'refresh' from 1 events Notice: Stage[main]: Would have triggered 'refresh' from...