Re: [Puppet Users] Augeas: Duplicate declaration

2014-01-20 Thread Reinaldo Lima
Almost there! =) My only change was '"host_entry_${name}" :' like you suggested, everything else in the code is like my first post, and the error now is: *"Could not evaluate: uninitialized constant Augeas::NO_MODL_AUTOLOAD"* *By the way, thank you so much for the help, this topic made me lear

Re: [Puppet Users] Augeas: Duplicate declaration

2014-01-18 Thread Nick Cammorato
Sorry, didn't realize it was a hash of hashes. You just need the augeas resource to have a unique name - entry[$name][hostname] or ipaddress should work. IE: define a_thing { augeas { 'host_entry': } } a_thing { 'a': } a_thing { 'b': } Will generate an error like you are seeing. define a_thi

Re: [Puppet Users] Augeas: Duplicate declaration

2014-01-17 Thread Andrey Kozichev
ah, right you are supplying entire hash in your defined resource. Missed it. If your defined resource would accept: name, iphost and hostname - then you can use create_resources to define all 3 entry. On 17 Jan 2014 15:21, "Reinaldo Lima" wrote: > With "create_resources" the error is: > > *Inval

Re: [Puppet Users] Augeas: Duplicate declaration

2014-01-17 Thread Reinaldo Lima
With "create_resources" the error is: *Invalid parameter hostName on node* And including the entry[name] in the resource name: *Resource title must be a String, not Hash* =( On Friday, January 17, 2014 5:10:16 AM UTC-2, Andrew wrote: > > another option to use create_resources('hostinclude'

Re: [Puppet Users] Augeas: Duplicate declaration

2014-01-16 Thread Andrey Kozichev
another option to use create_resources('hostinclude',$netentry) On 16 Jan 2014 23:47, "Nick Cammorato" wrote: > Your augeas resource is always called hosts_include which is why it's > doing that. Try including the entry[name] in that resource name. > On Jan 16, 2014 4:15 PM, "Reinaldo Lima" wro

Re: [Puppet Users] Augeas: Duplicate declaration

2014-01-16 Thread Nick Cammorato
Your augeas resource is always called hosts_include which is why it's doing that. Try including the entry[name] in that resource name. On Jan 16, 2014 4:15 PM, "Reinaldo Lima" wrote: > Hi Everyone, > > I'm trying to write a class that put some entries in "/etc/hosts" file as > follow below: > >

[Puppet Users] Augeas: Duplicate declaration

2014-01-16 Thread Reinaldo Lima
Hi Everyone, I'm trying to write a class that put some entries in "/etc/hosts" file as follow below: *class hosts {* *$netentry = {* *host01 => { iphost => '192.168.10.1', hostName => host01 },* *host02 => { iphost => '192.168.10.2', hostName => host02