Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

hiera gives different answer on puppetmaster and client

$
0
0
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.bar
Then 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.bar
Then 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":String
Is 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.

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>