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,
}
}
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 https://puppet.com/docs/puppet/latest/nodes_external.html
If you want to avoid applying anything on your file, you can add something like this in
site.pp
: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:
then use in
site.pp
: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
which make will prevent to node from beeing matched by is fqdn, so the default config will be applied if one exists (see comment of @GargantuChet)