Puppet agent not picking up hiera

127 views
Skip to first unread message

Alexander Dacre

unread,
Jun 23, 2015, 5:52:45 AM6/23/15
to puppet...@googlegroups.com
Hi,

I'm in the process of deploying my first Puppet instance with hiera and environments but I'm having some difficulties. Configuration files listed below with the host names removed.

[me@puppet puppet]$ cat /etc/puppet/hiera.yaml
---
:backends:
  - yaml
:yaml:
  :datadir: "/etc/puppet/environments/%{::environment}"
:hierarchy:
  - "nodes/%{::fqdn}"

[me@puppet puppet]$ cat /etc/puppet/environments/production/nodes/servers-fqdn.yaml
---
ntp::restrict:
  -
ntp::autoupdate: false
ntp::enable: true
ntp::servers:
  - 0.us.pool.ntp.org iburst
  - 1.us.pool.ntp.org iburst
  - 2.us.pool.ntp.org iburst
  - 3.us.pool.ntp.org iburst

[me@puppet puppet]$ cat /etc/puppet/environments/production/manifests/site.pp
hiera_include('classes')


Seems to work from the command line:

[me@puppet puppet]$ sudo hiera ntp::servers ::fqdn=servers-fqdn ::environment=production
 "1.us.pool.ntp.org iburst",
 "2.us.pool.ntp.org iburst",
 "3.us.pool.ntp.org iburst"]

But not on the agents?

Any suggestions on what I;m doing wrong?

Thanks,
Alex

Alexander Dacre

unread,
Jun 23, 2015, 6:27:33 AM6/23/15
to puppet...@googlegroups.com
This is running on Puppet 3.8.1

Craig Dunn

unread,
Jun 26, 2015, 5:16:04 AM6/26/15
to puppet...@googlegroups.com
>> Seems to work from the command line:
>>
>> [me@puppet puppet]$ sudo hiera ntp::servers ::fqdn=servers-fqdn
>> ::environment=production
>> ["0.us.pool.ntp.org iburst",
>> "1.us.pool.ntp.org iburst",
>> "2.us.pool.ntp.org iburst",
>> "3.us.pool.ntp.org iburst"]
>>
>> But not on the agents?

Did you restart puppet server after making the changes to hiera.yaml?
It caches the config in hiera.yaml on start up. That could explain
why you are seeing different behaviour on the command line.


--
Enviatics | Automation and configuration management
http://www.enviatics.com | @Enviatics
Puppet Training http://www.enviatics.com/training/
Reply all
Reply to author
Forward
0 new messages