Before Fix
With default hiera.yaml, it correctly uses node-specific hierarchy:
0 ~/work/puppet (ticket/stable/PUP-4777-bump-hiera-dependency) $ cat ~/.puppetlabs/etc/code/hiera.yaml
|
---
|
:backends:
|
- yaml
|
:hierarchy:
|
- "nodes/%{::trusted.certname}"
|
- common
|
|
:yaml:
|
# datadir is empty here, so hiera uses its defaults:
|
# - /etc/puppetlabs/code/environments/%{environment}/hieradata on *nix
|
# - %CommonAppData%\PuppetLabs\code\environments\%{environment}\hieradata on Windows
|
# When specifying a datadir, make sure the directory exists.
|
:datadir:
|
0 ~/work/puppet (ticket/stable/PUP-4777-bump-hiera-dependency) $ be puppet apply --certname arcturus -e "notice( hiera( 'testkey' ))"
|
Notice: Scope(Class[main]): from_arcturus
|
Notice: Compiled catalog for arcturus in environment production in 0.33 seconds
|
Notice: Applied catalog in 0.02 seconds
|
When default hierarchy is removed, uses the incorrect "common" hierarchy:
0 ~/work/puppet (ticket/stable/PUP-4777-bump-hiera-dependency) $ cat ~/.puppetlabs/etc/code/hiera.yaml
|
---
|
:backends:
|
- yaml
|
|
:yaml:
|
# datadir is empty here, so hiera uses its defaults:
|
# - /etc/puppetlabs/code/environments/%{environment}/hieradata on *nix
|
# - %CommonAppData%\PuppetLabs\code\environments\%{environment}\hieradata on Windows
|
# When specifying a datadir, make sure the directory exists.
|
:datadir:
|
0 ~/work/puppet (ticket/stable/PUP-4777-bump-hiera-dependency) $ be puppet apply --certname arcturus -e "notice( hiera( 'testkey' ))"
|
Notice: Scope(Class[main]): from_common
|
Notice: Compiled catalog for arcturus in environment production in 0.33 seconds
|
Notice: Applied catalog in 0.02 seconds
|
When default hiera.yaml is removed, uses the incorrect "common" hierarchy:
0 ~/work/puppet (ticket/stable/PUP-4777-bump-hiera-dependency) $ rm ~/.puppetlabs/etc/code/hiera.yaml
|
0 ~/work/puppet (ticket/stable/PUP-4777-bump-hiera-dependency) $ be puppet apply --certname arcturus -e "notice( hiera( 'testkey' ))"
|
Notice: Scope(Class[main]): from_common
|
Notice: Compiled catalog for arcturus in environment production in 0.33 seconds
|
Notice: Applied catalog in 0.02 seconds
|
With Fix
It correctly uses node-specific hierarchy in all cases.
With default hiera.yaml:
##
|
0 ~/work/puppet (ticket/stable/PUP-4777-bump-hiera-dependency) $ cat ~/.puppetlabs/etc/code/hiera.yaml
|
---
|
:backends:
|
- yaml
|
:hierarchy:
|
- "nodes/%{::trusted.certname}"
|
- common
|
|
:yaml:
|
# datadir is empty here, so hiera uses its defaults:
|
# - /etc/puppetlabs/code/environments/%{environment}/hieradata on *nix
|
# - %CommonAppData%\PuppetLabs\code\environments\%{environment}\hieradata on Windows
|
# When specifying a datadir, make sure the directory exists.
|
:datadir:
|
0 ~/work/puppet (ticket/stable/PUP-4777-bump-hiera-dependency) $ be puppet apply --certname arcturus -e "notice( hiera( 'testkey' ))"
|
Notice: Scope(Class[main]): from_arcturus
|
Notice: Compiled catalog for arcturus in environment production in 0.36 seconds
|
Notice: Applied catalog in 0.02 seconds
|
When default hierarchy is removed:
0 ~/work/puppet (ticket/stable/PUP-4777-bump-hiera-dependency) $ cat ~/.puppetlabs/etc/code/hiera.yaml
|
---
|
:backends:
|
- yaml
|
|
:yaml:
|
# datadir is empty here, so hiera uses its defaults:
|
# - /etc/puppetlabs/code/environments/%{environment}/hieradata on *nix
|
# - %CommonAppData%\PuppetLabs\code\environments\%{environment}\hieradata on Windows
|
# When specifying a datadir, make sure the directory exists.
|
:datadir:
|
0 ~/work/puppet (ticket/stable/PUP-4777-bump-hiera-dependency) $ be puppet apply --certname arcturus -e "notice( hiera( 'testkey' ))"
|
Notice: Scope(Class[main]): from_arcturus
|
Notice: Compiled catalog for arcturus in environment production in 0.33 seconds
|
Notice: Applied catalog in 0.02 seconds
|
When default hiera.yaml is removed:
0 ~/work/puppet (ticket/stable/PUP-4777-bump-hiera-dependency) $ rm ~/.puppetlabs/etc/code/hiera.yaml
|
0 ~/work/puppet (ticket/stable/PUP-4777-bump-hiera-dependency) $ be puppet apply --certname arcturus -e "notice( hiera( 'testkey' ))"
|
Notice: Scope(Class[main]): from_arcturus
|
Notice: Compiled catalog for arcturus in environment production in 0.38 seconds
|
Notice: Applied catalog in 0.02 seconds
|
|