Having the following yaml file:
profile::monitoring::satellite_poller::zones:
'zone01-master':
'global': false
'zone01':
'endpoints':
"%{::fqdn}":
'host': "%{::ipaddress}"
'port': '5665'
'parent': 'zone01-master'
'global': false
When using a local puppet apply, the %{::fqdn} gets interpolated into the host fqdn.
When running with puppet agent, connected to a puppetmaster with puppetdb backend, the %{::fqdn} stays literal "%{::fqdn}" but %{::ipaddress} gets the ip value.
running a hiera lookup on the puppetmaster fetches the right info
hiera profile::monitoring::satellite_poller::zones --config /etc/puppet/hiera.yaml ::fqdn=test ::ipaddress=127.0.0.1
{"zone01-master"=>{"global"=>false},
"zone01"=>
{"parent"=>"zone01-master",
"global"=>false,
"endpoints"=>{"test"=>{"port"=>"5665", "host"=>"127.0.0.1"}}}}
According to https://docs.puppet.com/hiera/1/variables.html It is valid since it's not the root key that is dynamic.
running Puppetmaster 3.6.1 , hiera 1.3.4
↧