Ask Your Question

Access parameter from a resource defined using create_resources

asked 2013-10-02 21:46:36 -0600

hveiga gravatar image

I would like to know if it is possible to access a parameter from a class being instantiated using the create_resources function. I want to use that parameter in other class to conditionally install some things or not.

This is my scenario:

define myResource($myParam) { ... }

create_resources(myResource, $hashResources)

$hashResources = { "MyResource1" : { "myParam" : 1 },
                             "MyResource2" : { "myParam" : 2 }

myFancyPuppetClass($nameOfResource) {
 if(*myParam from the resource defined with name $nameOfResource in the same catalog**) { ... }

Is this possible? If it is, how can I do the reference? I am wondering if there is a way to say $myResource[MyResource1]::myParam or something similar. Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-10-03 02:15:16 -0600

Ancillas gravatar image

updated 2013-10-03 02:15:46 -0600

Would the defined_with_params function in stdlib work for you?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-10-02 21:46:36 -0600

Seen: 407 times

Last updated: Oct 03 '13