Hello,

A Divendres 06 Febrer 2009, Peter Meier va escriure:
> Hi
>
> >> > no. you can use the variables provided by the external tool in the
> >> > classes you include. you even then could implement kind of default
> >> > values for these variables in the class.
> >
> > In think your example gives a false idea of a solution because you
> > have only one call to the definition
> > If you don't know in advance how many call you'll have to use,
> > you must say N times some thing like =>  testdefine{"name_${test_i}":
> > param => $testparam_i }
> > Moreover if you have several arguments to the definition you end up
> > with a bunch of parameters to deal with.
> >
> > So each time you want to change the number of calls, you have to
> > modify the class, which mean writing some .pp file
> > Thus the benefits of using external node is lost by the need to modify
> > this class each time.
>
> yeah I missed that point. My solution doesn't work if you'd like to
> call a define more than once. actually you could do it with an array.
> however then the define can't have any params. :/

If you apply the patch in http://projects.reductivelabs.com/issues/show/1858 
to puppetmaster, you can call functions from an external nodes hash, wich can 
contain the parameters for the function:

external nodes yaml:

  files:
    passwd:
      owner: root
      group: root
      mode: 644
      source: xxxxx
    shadow:
      owner: root
      group: shadow
      mode: 640
      source: yyyyy

puppet manifest:

define remote_file($owner, $group,$mode,$source,$source) {
  ...
}
remote_file { $files: }

function "remote_file" is called two times with different arguments each time

> >>> this is completely besides the discussion if it should be able to call
> >>> defines from an external tool.
> >
> > well, it's an extension of the discussion. If i can't do something
> > with the language it is a good question to know if we can change or
> > extend it, no ?
>
> for sure.
>
> > Do you want me to start a new topic ?
>
> I think the current topic is good enough to discuss if this is
> possible and might be the problems. Maybe it's not even a big deal for
> you to implement it, if people can redirect you to the right place.
>
> cheers pete
>
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to