1
votes

I am new to Puppet and Hiera, and having a configuration issue when attempting to apply a module the contains a Hiera lookup to an agent.

From /etc/puppetlabs/puppet/hiera.yaml:

---
:backends:
  - yaml
:hierarchy:
  - defaults
  - "%{clientcert}"
  - "%{environment}"
  - global

:yaml:
  :datadir: '/etc/puppetlabs/puppet/hiera'

From /etc/puppetlabs/puppet/hiera/develop.yaml:

git_client:
    file_content:here

When running Hiera to debug:

/opt/puppet/bin/hiera git_client environment=develop -c /etc/puppetlabs/puppet/hiera.yaml --debug

DEBUG: 2015-05-12 12:40:27 -0400: Hiera YAML backend starting
DEBUG: 2015-05-12 12:40:27 -0400: Looking up git_client in YAML backend
DEBUG: 2015-05-12 12:40:27 -0400: Looking for data source defaults
DEBUG: 2015-05-12 12:40:27 -0400: Cannot find datafile /etc/puppetlabs/puppet/hiera/defaults.yaml, skipping
DEBUG: 2015-05-12 12:40:27 -0400: Looking for data source develop
DEBUG: 2015-05-12 12:40:27 -0400: Found git_client in develop
file_content:here

Windows agent configuration from puppet.conf:

[main]
server=[REDACTED]
pluginsync=true
autoflush=true
archive_files=true
archive_file_server=[REDACTED]
graph=true
environment=develop

But when running from the Windows agent:

Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find data item git_client in any Hiera data file and no default supplied at /etc/puppetlabs/puppet/environments/develop/modules/[REDACTED PATH TO .pp FILE]:24 on node [REDACTED]
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

I must have something misconfigured, but I'm not sure where. Any help would be appreciated.

1
show me the puppet.conf file on windows agent.BMW
what version of PE. if you are using the pe-puppetserver did you restart it? or if you are using the passenger puppet master did you restart that? i have found that when making changes to a hiera config file you typically need to bounce your master.ptierno
@BMW, I added the puppet.conf from the Windows agent.grefly
@ptierno, you are correct, restarting the pe-puppetserver resolved the issue. If you respond I'll mark accepted answer. Thanks!grefly

1 Answers

1
votes

In order for changes to your hiera configuration to take effect, you need to make sure to restart your puppet master. If you are using the puppetserver that runs in the JVM then restart the pe-puppetserver service. If you are using the old ruby master running on passenger, then restart pe-httpd.

Taken from the hiera docs:

Puppet master note: If you modify hiera.yaml between agent runs, you’ll have to restart your puppet master for your changes to take effect.