Let''s say I have a define in class ''foo'' called
''foo::bar'':
define foo::bar ($var1, $var2) {
...
}
Then I have a ruby hostclass
hostclass :foo do
...
}
I see I can successfully set the parameters by doing:
environment.known_resource_types.definitions[''foo::bar''].set_arguments
:var1 => ''val1'', :var2 => ''val2''
But this raises two problems.
1) foo::bar doesn''t exist in known_resource_types.definitions unless
you add it manually or it exists in the same rb file as the class. So how I do
an auto load?
2) How do I actually call it?
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Oliver Schad
2011-Mar-05 09:27 UTC
Re: [Puppet Users] Calling class defines in pure ruby DSL
Am Thursday 09 December 2010 schrieb mir Carl Caum:> Let''s say I have a define in class ''foo'' called ''foo::bar'': > > define foo::bar ($var1, $var2) { > ... > } > > Then I have a ruby hostclass > > hostclass :foo do > ... > } > > I see I can successfully set the parameters by doing: > > environment.known_resource_types.definitions[''foo::bar''].set_arguments > :var1 => ''val1'', :var2 => ''val2'' > > But this raises two problems. > 1) foo::bar doesn''t exist in known_resource_types.definitions unless > you add it manually or it exists in the same rb file as the class. So > how I do an auto load? 2) How do I actually call it?Did you find a solution for the problem? Regards Oli