Ask Your Question
0

Puppet 4 not using custom facts

asked 2017-03-09 15:18:05 -0500

dmanley gravatar image

updated 2017-03-09 21:14:05 -0500

We are currently running a Puppet 3 system and looking to build out a new system with puppet 4. Currently it is not using our hiera because it is not reading the custom facts that we created.

Our hiera.yaml:

---
:backends:
    - yaml
 :yaml:
    :datadir: "/etc/puppet/hiera/%{::zone}"
:hierarchy:
    - "%{::subdom4}"
    - "%{::subdom3}"
    - "%{::subdom2}"
    - "%{::subdom1}"
    - "%{::subdom0}"
    - common

If we run /opt/puppetlabs/bin/facter you will not see the "zone" or "subdom" facts. if we run /opt/puppetlabs/bin/facter -p they will show up.

But running /opt/puppetlabs/bin/hiera -d messages, we get this:

DEBUG: 2017-03-09 16:12:26 -0500: Hiera YAML backend starting
DEBUG: 2017-03-09 16:12:26 -0500: Looking up messages in YAML backend
DEBUG: 2017-03-09 16:12:26 -0500: Ignoring bad definition in :hierarchy: ''
DEBUG: 2017-03-09 16:12:26 -0500: Ignoring bad definition in :hierarchy: ''
DEBUG: 2017-03-09 16:12:26 -0500: Ignoring bad definition in :hierarchy: ''
DEBUG: 2017-03-09 16:12:26 -0500: Ignoring bad definition in :hierarchy: ''
DEBUG: 2017-03-09 16:12:26 -0500: Ignoring bad definition in :hierarchy: ''
DEBUG: 2017-03-09 16:12:26 -0500: Ignoring bad definition in :hierarchy: ''
DEBUG: 2017-03-09 16:12:26 -0500: Looking for data source common
DEBUG: 2017-03-09 16:12:26 -0500: Cannot find datafile /etc/puppet/hiera/common.yaml, skipping
nil

We can also see the facts in puppet facts --debug

This is on a CentOS 7 setup with PuppetDB using postgresql 9.6

Any ideas what else to try or look into?

edit retag flag offensive close merge delete

Comments

Shot in the dark, but does it work if you remove the leading scope indicator? i know I've had issues with that before

DarylW gravatar imageDarylW ( 2017-03-09 21:44:37 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-03-09 23:01:32 -0500

Red Cricket gravatar image

updated 2017-03-11 17:38:28 -0500

I assume you are running hiera command line on your puppet master. Your puppet master probably doesn't have the subdomain custom fact configured, so you need to tell hiera the value of the custom fact is like:

hiera message "::subdomain4=whatever"
edit flag offensive delete link more

Comments

It looks to be that the problem is that puppet is running without using the custom facts. The custom facts are in PuppetDB. Ehen puppet runs, it is ignoring the custom facts so it can't populate the hiera and the servers do not get configured.

dmanley gravatar imagedmanley ( 2017-03-10 11:17:02 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2017-03-09 15:18:05 -0500

Seen: 39 times

Last updated: Mar 11