polaris_s0i
2012-Jul-05 19:31 UTC
[Puppet Users] Ruby DSL parameterized classes and defaults
I''ve been reading the Docs on this, and its not very clear. I want to have a parameterized class that takes arrays and objects as parameters. I''m using puppet 2.6.16. I define a hostclass like this: hostclass :test, :arguments => { :param1 => "blah" } do end I call from Puppet DSL: class {"test": } I get this as an error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error NoMethodError: undefined method `safeevaluate'' for "blah":String at /data/puppet/nbenns/modules/atg/manifests/init.pp:56 on node <removed> If I add the parameter in its fine. If :arguments => { :param1 => "blah" } isn''t used as :arguments => { paramname => default value } then what is it? the documentation isn''t clear at all on this. Thanks. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/f4AQx0T8Wv4J. 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.
llowder@oreillyauto.com
2012-Jul-05 21:30 UTC
[Puppet Users] Re: Ruby DSL parameterized classes and defaults
Comments inline. On Thursday, July 5, 2012 2:31:47 PM UTC-5, polaris_s0i wrote:> > I''ve been reading the Docs on this, and its not very clear. > > I want to have a parameterized class that takes arrays and objects as > parameters. > I''m using puppet 2.6.16. > > I define a hostclass like this: > > hostclass :test, :arguments => { :param1 => "blah" } do > > end > > I call from Puppet DSL: > >Try using it in the other way: include test rather than in the parametrized way.> class {"test": > > } > > I get this as an error: > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Puppet::Parser::AST::Resource failed with error NoMethodError: undefined > method `safeevaluate'' for "blah":String at > /data/puppet/nbenns/modules/atg/manifests/init.pp:56 on node <removed> > > If I add the parameter in its fine. > > If :arguments => { :param1 => "blah" } isn''t used as :arguments => { > paramname => default value } > then what is it? > the documentation isn''t clear at all on this. > > Thanks. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/CPQDyooO848J. 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.