Hi all
I ran into a problem asking hiera a complex data structure.
Let's say, I configure my network and create for the puppetmaster itself a .yaml file:
--- network: address: 172.1.1.12 netmask: 255.255.255.0 gateway: 172.1.1.1 dns-nameservers: - '172.1.3.9' - '172.1.5.9' dns-search: foo.bar dns-domain: foo.barThen I create a class:
class network { $network = hiera("network") notify{"The networt is: ${network}": } }And ask puppet master to run it:
root@master# puppet agent -t (...) Notice: The networt is: {"address"=>"172.1.1.12", "netmask"=>"255.255.255.0", "gateway"=>"172.1.1.1", "dns-nameservers"=>["172.1.3.9", "172.1.5.9"], "dns-search"=>"foor.bar", "dns-domain"=>"foo.bar"} (...)For another machine I copy the .yaml file und change the address.
--- network: address: 172.1.1.13 netmask: 255.255.255.0 gateway: 172.1.1.1 dns-nameservers: - '172.1.3.9' - '172.1.5.9' dns-search: foo.bar dns-domain: foo.barThen I ask puppet to run on the client:
root@client# puppet agent -t (...) Notice: The networt is: {"address"=>"172.1.1.13", "netmask"=>"255.255.255.0", "gateway"=>"172.1.1.1", "dns-nameservers"=>"-172.1.3.9 -172.1.5.9", "dns-search"=>"foor.bar"} (...)At the client, it looses one hash and misreads the other. In real production, running on the client, my template.erb fails with a:
Detail: undefined method `each' for "-172.1.3.9 -172.1.5.9":StringIs the .yaml to comlex? Do I make a syntax error? Why is it running on the puppet master but not on the client? Thanks for your help.