Re: [Puppet Users] "Listing" the keys in a hash as an array

2011-04-19 Thread Miki Shapiro
Thanks guys I ended up breaking up what Felix&Ohad suggested into two lines to make it work: $keycsv= inline_template("<%= netifcfg.keys.join(',') %>") $keys = split ($keycsv,',') Yep, it's a 'hack' (sorry, Ohad, workaround ;)), but it saves me having to add puppet functions into

Re: [Puppet Users] "Listing" the keys in a hash as an array

2011-04-19 Thread Miki Shapiro
I must be doing something wrong... As suggested by Ohad: Manifest says: $keys = inline_template("<%= netifcfg.keys %>") exec { "/bin/echo keys are $keys and netifcfg is $netifcfg": logoutput => true } Output says: notice: /Stage[main]/Base::Network-common/Exec[/bin/echo keys are bond0bond1 and n

Re: [Puppet Users] "Listing" the keys in a hash as an array

2011-04-19 Thread Miki Shapiro
I must be doing something wrong... As suggested by Ohad: Manifest says: $keys = inline_template("<%= netifcfg.keys %>") exec { "/bin/echo keys are $keys and netifcfg is $netifcfg": logoutput => true } Output says: notice: /Stage[main]/Base::Network-common/Exec[/bin/echo keys are bond0bond1 and n

[Puppet Users] "Listing" the keys in a hash as an array

2011-04-18 Thread Miki Shapiro
Hi all I've got node definition on the site with server interface, bonding and TCP/IP configurations inscribed in a per-node [ hash + accompanying array-of-interface-names ] (e.g. $array = [ 'eth0', 'eth1' ] $hash = { eth0 => { ipaddress => 1.2.3.4, ... } eth1 => { ip