We use a wrapper resource to ensure that only one resource is created. It's 
not perfect, because you need an additional resource, but it works. Here is 
an example:

Multiple nodes want to ensure that the following resource is created on a 
node:

file { '/tmp/at_least_one_node_exists.txt':
}

so we create a wrapper resource:

define export_file (
  filename,
) {
  ensure_resource('file', $filename, {})
}

and export the wrapper resource (here you need different names for all 
nodes, so we use fqdn in the name):

@@export_file { "${fqdn}_one_node":
  filename => '/tmp/at_least_one_node_exists.txt',
}

and also collect the wrapper resource on the destination node:

Export_file <<| |>>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/999f5533-1ead-4d11-8c63-4d00d0c4dc95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to