Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

is there an option to set a node on hold (set it on noop), on the puppetmaster side? i am looking for a setting like in the example below. every node which has a variable called noop set to true in it's definition, won't be updated.

so example1.node.com will not have the test1 file after multiple puppet client runs but example2.node.com will have the file.

is there such an option? does another approach exist? (of course i can simple add a "_" to the node name and it will stop matching. i am looking for the official way.

node "example1.node.com"
{
    $noop = true
    file 
    {
        "/root/test1":
            content => "test",
            ensure => present,
    }
}

node "example2.node.com"
{
    file 
    {
        "/root/test1":
            content => "test",
            ensure => present,
    }
}
share|improve this question
2  
Not directly answering the question, but mcollective works really well for disabling puppet and also scheduling puppet runs on your nodes. –  robbyt Jun 25 '12 at 13:56
add comment

2 Answers

A common approach is to use an external node classifier to attach classes and/or attributes to nodes using your own business logic. It is documented on http://docs.puppetlabs.com/guides/external_nodes.html

If you want to avoid applying anything on your file, you can add something like this in site.pp:

if $noop == true {
  fail('noop, I don't do anything!')
}

A bit more advanced. If you want puppet to avoid applying your manifests if /etc/noop exists on the system, you could create a custom fact:

Facter.add('noop') { setcode { File.exists? '/etc/noop' } }

then use in site.pp:

if $::noop == true {
  fail('noop, I don't do anything!')
share|improve this answer
add comment
up vote 1 down vote accepted

I haven't found a way to set noop in the node definition such that I would see changes on the client (like the client agent was run with --noop), but the faster way for me to disable a node was:

Adding an underscore in front of the node name, like _example1.node.com

node "_example1.node.com"
{
    file 
    {
        "/root/test1":
            content => "test",
            ensure => present,
    }
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.