Re: [Puppet-dev] Best way to parse /etc/services - I'm stuck

2010-12-18 Thread Stefan Schulte
Hello again, I had a little time today so I decided to continue my work. But now I fall into another trap. I guess the parsedfile provider is not really prepared to handle multiple keyattribues: # FILE: lib/puppet/provider/parsedfile.rb def self.prefetch(resources = nil) # Reset the

Re: [Puppet-dev] Best way to parse /etc/services - I'm stuck

2010-12-05 Thread Stefan Schulte
On Sun, Dec 05, 2010 at 12:47:35AM +0100, Stefan Schulte wrote: I traced the cause of the problem to type.rb function namevar def []=(name,value) [...] if name == :name name = name_var ### -- name is false now (see below) end [...] property =

Re: [Puppet-dev] Best way to parse /etc/services

2010-11-30 Thread Hunter Haugen
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

Re: [Puppet-dev] Best way to parse /etc/services

2010-11-30 Thread Luke Kanies
On Nov 23, 2010, at 10:35 AM, Stefan Schulte 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,

Re: [Puppet-dev] Best way to parse /etc/services

2010-11-23 Thread Stefan Schulte
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

Re: [Puppet-dev] Best way to parse /etc/services

2010-11-22 Thread Peter Meier
So you possibly could write a define or something to do what you want there. And here is an example how it is done using augeas:

Re: [Puppet-dev] Best way to parse /etc/services

2010-11-22 Thread Stefan Schulte
On Mon, Nov 22, 2010 at 07:48:18AM +, Paul Nasrat wrote: I think there is an augeas lens for /etc/services - see eg http://projects.puppetlabs.com/projects/1/wiki/Puppet_Augeas#Adding+a+service+that+uses+both+TCP+and+UDP+to+/etc/services So you possibly could write a define or something

Re: [Puppet-dev] Best way to parse /etc/services

2010-11-22 Thread Dean Wilson
On 22 November 2010 17:37, Stefan Schulte stefan.schu...@taunusstein.net wrote: Hi Stefan, But I think that will mean, that I have to deploy augeas to all my machines. I was trying to avoid that. And I think that this file is worth it to be supported by puppet directly. From my understanding

Re: [Puppet-dev] Best way to parse /etc/services

2010-11-22 Thread Stefan Schulte
On Mon, Nov 22, 2010 at 05:54:48PM +, Dean Wilson wrote: From my understanding there is basic support for types with composite keys in the code base from 2.6 onwards. Might be worth looking at https://github.com/lak/puppet/commit/7c6b883 as a starting point. It sounds interesting but it

Re: [Puppet-dev] Best way to parse /etc/services

2010-11-22 Thread Luke Kanies
On Nov 22, 2010, at 11:37 AM, Stefan Schulte wrote: On Mon, Nov 22, 2010 at 07:48:18AM +, Paul Nasrat wrote: I think there is an augeas lens for /etc/services - see eg

[Puppet-dev] Best way to parse /etc/services

2010-11-21 Thread Stefan Schulte
Hi, I wanted to write a resourcetype to manage ports in /etc/services. I did write a type where you can do something like: port { 'telnet', protocol = 'tcp', number= '22', port_aliases = ['alias1','alias2'], } This is totally sufficient for ME (I'm realising entries that just use tcp,

Re: [Puppet-dev] Best way to parse /etc/services

2010-11-21 Thread Paul Nasrat
On 21 November 2010 11:01, Stefan Schulte stefan.schu...@taunusstein.net wrote: Hi, I wanted to write a resourcetype to manage ports in /etc/services. I did write a type where you can do something like: port { 'telnet',  protocol = 'tcp',  number    = '22',  port_aliases =