Hey comm,
**Setup puppet server**
CentOS 7.1.1503
puppet 4.2.3
facter 3.1.1
hiera 3.0.4
**Setup puppet agent**
CentOS 7.1.1503
puppet 4.2.3
facter 3.1.1
hiera 3.0.4
**Question**
I simply would like to merge facts in my hiera.yaml like the following.
`"/hieradata/os/CentOS7.yaml"`.
So that I can make an array base_packages and have a specific package `epel-release` installed on CentOS 7 (but **not** on Debian 7 for example)
I'm trying to construct my hiera.yaml `:hierarchy:` with different variables from facter like: `"os/%{::operatingsystem}%{::operatingsystemmajrelease}"`.
**I tried the following in my `hiera.yaml` `:hierarchy:` to no avail:**
- `"os/%{::operatingsystem}%{::operatingsystemmajrelease}"` (file containing `base_package` array in `/hieradata/os/CentOS7.yaml`)
- `"os/%{::operatingsystem}-%{::operatingsystemmajrelease}"` (file containing `base_package` array in `/hieradata/os/CentOS-7.yaml`)
- `"os/%{::operatingsystem}%/{::operatingsystemmajrelease}"` (file containing `base_package` array in `/hieradata/os/CentOS/7.yaml`)
**It only works if my `hiera.yaml` `:hierarchy:` contains:**
- `"os/%{::operatingsystem}"` (file containing `base_package` array in `/hieradata/os/CentOS.yaml`)
**or**
- `"os/%{::operatingsystemmajrelease}"` (file containing `base_package` array in `/hieradata/os/7.yaml`)
*This would result in the package `epel-release` being installed (or at least trying to and failing) on Debian 7 as well.*
**Debugging**
I've got a notify in my packages class to show me which packages would be installed by the agent.
Any idea why merging variables don't seem to work in hiera.yaml?
It seems that merging facts in hiera.yaml should work as intended but I'm not getting it to work.
↧