Skip to content

Instantly share code, notes, and snippets.

@jessereynolds
Last active November 8, 2016 00:28
Show Gist options
  • Save jessereynolds/97199f204ba50f44d13dd7411a49df14 to your computer and use it in GitHub Desktop.
Save jessereynolds/97199f204ba50f44d13dd7411a49df14 to your computer and use it in GitHub Desktop.
hiera 4 config syntax assuming environmentpath ?
$ hiera --debug --config hiera.yaml message
DEBUG: 2016-11-08 08:58:08 +1100: Hiera YAML backend starting
DEBUG: 2016-11-08 08:58:08 +1100: Looking up message in YAML backend
DEBUG: 2016-11-08 08:58:08 +1100: Looking for data source common
DEBUG: 2016-11-08 08:58:08 +1100: Cannot find datafile /etc/puppetlabs/code/environments//hieradata/common.yaml, skipping
nil
$ ls -ld hiera.yaml
-rw-r--r-- 1 jesse staff 245 7 Nov 10:16 hiera.yaml
p
$ ls -ld hieradata/common.yaml
-rw-r--r-- 1 jesse staff 126 7 Nov 10:16 hieradata/common.yaml
What about with puppet lookup ? How do you tell puppet lookup to use a particular hiera.yaml file?
$ puppet lookup --hiera_config hiera.yaml --configprint hiera_config
/Users/jesse/src/puppet/foo/puppet/hiera.yaml
I've raised https://tickets.puppetlabs.com/browse/PUP-6899 about this.
---
version: 4
datadir: hieradata
hierachy:
- name: "nodes/%{::fqdn}"
backend: yaml
- name: "environment/%{::cf_dc}/%{::cf_vsys}"
backend: yaml
- name: "environment/%{::cf_dc}"
backend: yaml
- name: common
backend: yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment