Sometimes, you want to disable a resource for a time 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,
This example shows you how to use the noop
metaparameter:
- Modify your
site.pp
file as follows:
node 'cookbook' { file { '/etc/resolv.conf': content => "nameserver 127.0.0.1\n", noop => true, } }
- Run Puppet:
[root@cookbook ~]# puppet agent -t ... Notice: /Stage[main]/Main/Node[cookbook]/File[/etc/resolv.conf]/content: --- /etc/resolv.conf 2018-03-15 16:12:55.727454381 +0000 +++ /tmp/puppet-file20180316-24960-1ioes0p 2018-03-16 07:57:56.690184900 +0000 @@ -1,3 +1 @@ -# Generated by NetworkManager -search strangled.net example.com -nameserver...