On Monday, March 24, 2014 11:19:43 AM UTC-5, A. Gorlov wrote:
>
> This is done already. 
> question about changes in 
>
> $keys = [ "key1", "key2" ]
> pubkey { $keys: user => $login  } 
>
> to post some other values to define
>
>
A defined type is just a resource type.  You can assign as many parameters 
as you like (of those supported by the definition) using the normal 
resource-declaration syntax.  The definition presented as an example 
defines only one parameter, but all resource types support all the 
metaparameters:

pubkey { $keys:
  user => $login,
  require => Package['ssh']
}

If you want the defined type to accept additional ordinary parameters then 
you need to add them to the parameter list in its definition:

define pubkey($user, $key, $fqdn) {
  ...
}


If, however, you are asking how to pass different parameter values for 
different elements of the array-valued resource title, you have to get more 
creative.  You could consider using the create_resources() function instead 
of a standard declaration (
http://docs.puppetlabs.com/references/3.stable/function.html#createresources), 
or you could do similar manually by putting all the wanted parameters in a 
hash keyed on user, and have the definition pull them out instance $name / 
$title.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/f94b7b26-e863-4f55-9130-e1748a9a1f6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to