If you wanted to have the service as the resource title and pass the
protocols as an array like this:

port { 'telnet',
  protocols => ['tcp', 'udp'],
  number    => '22',
  port_aliases => ['alias1','alias2'],
}

you can use a template that iterates on `protocols.each do |p|` and
returns multiple lines for the "content =>" in your defined resource.

-Hunter



On Tue, Nov 23, 2010 at 10:35, Stefan Schulte
<[email protected]> wrote:
> On Tue, Nov 23, 2010 at 12:36:07AM -0600, Luke Kanies wrote:
>> If you invert it, it works better:
>>
>> port { '22/udp': label => 'telnet' }
>>
>
> Havent thought of that an it looks pretty good for me. The duplication
> doesnt really bothers me, because I can easily write a define for that.
>
> But what I dont like about that approach is, that while it is good for
> adding entries its just near to useless when you're trying to detect
> errors. Because I think you rareley want to change the
> label of a port but maybe you want to check, if the specified port is
> actually right. (At least I want to do that). So in the example abvoe:
> If I already have
>
>  telnet 20/udp # someone copied&pasted but didnt changed port
>
> in my file, puppet will happily adding another telnet entry.
>
> -Stefan
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev?hl=en.

Reply via email to