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 as follows:

noop => true,

How to do it…

  1. Add the following to your manifest:
    file { "/tmp/test.cfg":
        content => "Hello, world!\n",
        noop => true,
         }
  2. Run Puppet:
    # puppet agent --test 
    info: Retrieving plugin
    info: Caching catalog for cookbook.bitfieldconsulting.com
    info: Applying configuration version '1306159566'
    notice: /Stage[main]//Node[cookbook]/File[/tmp/test.cfg]/ensure: ...

Get Puppet 2.7 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.