Hello, On 18.06.2009, at 10:03, Peter Meier wrote:
HiIs it possible to test if a particular resource has already been defined? I'd like to do something like this: if !Host["$fqdn"] { host {"$fqdn": ip => "$ipaddress_eth0" } } Essentially, test to see if there is no Host resource defined for the current server and if not, add a host entry for itself using the IP address of eth0.http://reductivelabs.com/trac/puppet/wiki/FunctionReference#defined
In principle, this should do. Unfortunately there's this small catch that:
"This function is unfortunately dependent on the parse order of the configuration when testing whether a resource is defined."
I have many situations where i would like to test whether a class ist defined or not. This does not work for most situations.
Would it be possible to rewrite "defined" such that it is not dependent on the parse order of manifest?
As I understand puppet, this is not easily achievable. I am not sure, though.
All the best, udo. -- :: udo waechter - r...@zoide.net :: N 52º16'30.5" E 8º3'10.1" :: genuine input for your ears: http://auriculabovinari.de :: your eyes: http://ezag.zoide.net :: your brain: http://zoide.net
smime.p7s
Description: S/MIME cryptographic signature