Hiera has stopped working correctly!

28 views
Skip to first unread message

Guy Matz

unread,
Dec 16, 2014, 9:32:06 AM12/16/14
to puppet...@googlegroups.com
Hiera is not honoring my hierarchy :-(

gmatz@bunnybear ~/Code/puppet $ cat hiera.yaml 
---
:hierarchy:
  - "%{::environment}"
  - common
:backends:
  - eyaml
  - yaml
:merge_behavior: deeper
:eyaml:
  :datadir: /home/gmatz/Code/puppet/hieradata
  :pkcs7_private_key: /home/gmatz/Code/puppet/keys/private_key.pkcs7.pem
  :pkcs7_public_key: /home/gmatz/Code/puppet/keys/public_key.pkcs7.pem
:yaml:
  :datadir: /home/gmatz/Code/puppet/hieradata

gmatz@bunnybear ~/Code/puppet $ grep activemq_password hieradata/production.eyaml 
activemq_password: &activemq_password ENC[PKCS7,MIIBeQYJKggEhMIIBHQIBAD. . . .

but it only looks for common:

gmatz@bunnybear ~/Code/puppet $ hiera -d -c ~/Code/puppet/hiera.yaml activemq_password environment=production
DEBUG: 2014-12-16 09:31:19 -0500: [eyaml_backend]: Hiera eYAML backend starting
DEBUG: 2014-12-16 09:31:19 -0500: [eyaml_backend]: Set option: datadir = /home/gmatz/Code/puppet/hieradata
DEBUG: 2014-12-16 09:31:19 -0500: [eyaml_backend]: Set option: pkcs7_private_key = /home/gmatz/Code/puppet/keys/private_key.pkcs7.pem
DEBUG: 2014-12-16 09:31:19 -0500: [eyaml_backend]: Set option: pkcs7_public_key = /home/gmatz/Code/puppet/keys/public_key.pkcs7.pem
DEBUG: 2014-12-16 09:31:19 -0500: [eyaml_backend]: Looking up activemq_password in eYAML backend
DEBUG: 2014-12-16 09:31:19 -0500: [eyaml_backend]: Looking for data source common
DEBUG: 2014-12-16 09:31:19 -0500: Hiera YAML backend starting
DEBUG: 2014-12-16 09:31:19 -0500: Looking up activemq_password in YAML backend
DEBUG: 2014-12-16 09:31:19 -0500: Looking for data source common
nil

Any thoughts would be greatly appreciated!!

Thanks,
Guy

Gavin Williams

unread,
Dec 16, 2014, 9:43:05 AM12/16/14
to puppet...@googlegroups.com
Guy

I think you need to pass in your environment to hiera using '::environment' rather than 'environment', as your hiera.yaml is looking for '::environment'... 

Cheers
Gav
Reply all
Reply to author
Forward
0 new messages