On Thursday, February 14, 2013 9:02:01 AM UTC-6, Dan wrote:
>
> Hi,
>
> I'm struggling to get this to work and don't understand where I'm going 
> wrong, can someone please guide me on how to correct?
>
> Basically I want to get an array in my nodes.pp, which is then used by my 
> templates file by cycling through it and writing a line of each element:
>
> nodes.pp:
> node test{
>         net::addr { 'routing':
>           routes = [
>             {
>                 address => '172.29.54.70',
>                 netmask => '255.255.255.0',
>                 gateway => '172.29.54.65',
>                 dev     => 'eth0',
>             },
>             {
>                 address => '192.168.1.3',
>                 netmask => '255.255.255.0',
>                 gateway => '192.168.1.1',
>                 dev     => 'eth3',
>             },
>           ]
>         }
> }
> When I run the puppet client i keep getting the following:
>
> err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Could not parse for environment production: Syntax error at '='; expected 
> '}' at /etc/puppet/manifests/nodes/
> test.pp:3 on node test.myincorp.net
>
>
Your data structure is wrong, you have something that is somewhere between 
a hash and and array.  

If "routes" is the name of the param for the net::addr define, then you 
need to use:

routes => 

and not 

routes =

Without seeing the full code (net::addr AND the template in question), it's 
hard to say what the best total fix is, but I suspect moving things into a 
hash of hashes and calling create_resources() may be one of the best 
options.

 

> Can someone please help?
>
> Thanks
> Dan
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to