Ask Your Question
0

hiera only finding common.yaml and fqdn.yaml [closed]

asked 2016-09-01 16:17:30 -0500

tab gravatar image

Hi All, I'm working on a new Puppet setup and I'm running into an issue with hiera where it only applies classes found in common.yaml or $fqdn.yaml. The Puppet Server is CentOS 6.8 running puppetserver.noarch 2.5.0-1.el6 @puppetlabs-pc1.

Below is my site.pp, following that is my hiera.yaml

cat site.pp
hiera_include('classes')

File {
  backup => false,
}
cat hiera.yaml
    ---
    :backends:
      - yaml
    :yaml:
      :datadir: "/etc/puppetlabs/code/environments/development/hieradata"
    :hierarchy:
      - "nodes/%{::fqdn}"
      - "osfamily/%{::os.family}-%{::os.release.major}"
      - "osfamily/%{::os.family}"
      - common

Below is the directory structure with directories for osfamily as well as individual nodes.

tree
.
├── common.yaml
├── hiera.yaml
├── nodes
│   ├── dev6.example.com.yaml
│   └── dev7.example.com.yaml
└── osfamily
    ├── RedHat-6.yaml
    ├── RedHat-7.yaml
    └── RedHat.yaml

The yaml files are very simple since I've been trying to cut everything out while debugging this.

cat common.yaml
---
classes:
  - bash
cat nodes/dev6.example.com.yaml
---
classes:
  - glibc
cat nodes/dev7.example.com.yaml
---
classes:
  - glibc
cat osfamily/RedHat-6.yaml
---
classes:
  - postfix
cat osfamily/RedHat-7.yaml
---
classes:
  - postfix
cat osfamily/RedHat.yaml
---
classes:
  - httpd

I've been browsing the questions related to hiera, and it seems a lot of people have issues similar to this, one person updated to the latest and the issue vanished. I have verified the clients are sending the os.family and os.release.major facts. Thanks for taking a look.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by tab
close date 2016-09-02 08:17:34.121131

1 Answer

Sort by » oldest newest most voted
0

answered 2016-09-02 08:17:06 -0500

tab gravatar image

I ended up figuring this out, I needed to symlink /etc/puppetlabs/code/environments/development/hieradata/hiera.yaml to /etc/puppetlabs/puppet/puppet.conf

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-09-01 16:17:30 -0500

Seen: 106 times

Last updated: Sep 02 '16