I have a puppet master (version 3.8.1) set up, with a hiera.yaml file which I think is set up correctly, like so:
pete@ip-172-31-4-61:~$ cat /etc/puppet/hiera.yaml
---
:hierarchy:
- "%{::fqdn}"
:backends:
- yaml
:yaml:
:datadir: '/etc/puppet/hieradata'
When I run the following command:
sudo puppet master --verbose --debug --compile ip-10-1-3-7
(ip-10-1-3-7 is one of my nodes) I do not see any information in the catalog based on my hiera data. Even more confusing is I do not see this line in the debug:
Debug: hiera(): Hiera YAML backend starting
Which I do see in other puppet masters I have that do work with Hiera
UPDATE: I have edited my puppet.conf file to include hiera_config as per the comments below, and restarted puppetmaster but it still does not work.
pete@ip-172-31-4-61:~$ cat /etc/puppet/puppet.conf
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
certname = master
dns_alt_names = puppet
hiera_config = $confdir/hiera.yaml
[master]
# These are needed when the puppetmaster is run by passenger
# and can safely be removed if webrick is used.
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
I am running Ubuntu 14.04, with the package repo from puppetlabs:
pete@ip-172-31-4-61:~$ cat /etc/issue
Ubuntu 14.04.2 LTS \n \l
pete@ip-172-31-4-61:~$ dpkg -l "puppet*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===========================-==================-==================-============================================================
rc puppet 3.8.1-1puppetlabs1 all Centralized configuration management - agent startup and com
ii puppet-common 3.8.1-1puppetlabs1 all Centralized configuration management
un puppet-el <none> <none> (no description available)
un puppetdb-terminus <none> <none> (no description available)
ii puppetlabs-release 1.0-11 all "Package to install Puppet Labs gpg key and apt repo"
un puppetlabs-release-devel <none> <none> (no description available)
rc puppetlabs-release-pc1 0.9.2-1trusty all Release packages for the Puppet Labs PC1 repository
ii puppetmaster 3.8.1-1puppetlabs1 all Centralized configuration management - master startup and co
ii puppetmaster-common 3.8.1-1puppetlabs1 all Puppet master common scripts
UPDATE: Layout of hieradata dir:
pete@ip-172-31-4-61:~$ tree /etc/puppet/hieradata
/etc/puppet/hieradata
└── ip-10-1-3-7.yaml
Contents of hiera node file:
pete@ip-172-31-4-61:~$ cat /etc/puppet/hieradata/ip-10-1-3-7.yaml
---
classes:
- nginx
nginx::nginx_upstreams:
'app':
ensure: present
members:
- localhost:5000
'site':
ensure: present
members:
- site.my-app.com
nginx::nginx_vhosts:
'localhost':
proxy: 'http://site'
proxy_read_timeout: '5'
nginx::nginx_locations:
app:
location: '~ "^/(members|login|logout)"'
vhost: localhost
proxy: 'http://app'
proxy_read_timeout: '20'
ssl: false
location_cfg_append:
proxy_set_header:
- 'X-Forwarded-Host $http_host'
I am reasonably confident it is not to do with the hieradata node files as even on another puppet master where there is no node file for the host, I still get the Debug: hiera(): Hiera YAML backend starting debug line.
puppet.conf
? – Shane Madden Jul 14 '15 at 18:04hiera_config = $confdir/hiera.yaml
in puppet.conf? – chetangb Jul 14 '15 at 18:37$confdir
automatically defined? If not it may need to be defined manually. This may be a coincidence/unimportant but based on the IPs the two nodes you are using are on two separate subnets, 172.31.4.61 and 10.1.3.7. is it safe to assume you have setup appropriate routing table entries so the nodes on different networks can communicate, services are listening on appropriate ports+IPs and the firewall, ACLs,etc have been configured correctly to allow access between the networks? – Matt Jul 21 '15 at 17:10$confdir
and set an absolute path but still no luck. The master is on a public IP but the node has access to it through a NAT device - I have checked a puppet run on the client - it just completes with nothing applied – cubabit Jul 21 '15 at 17:15