heira debug not working

23 views
Skip to first unread message

Jagga Soorma

unread,
Sep 24, 2016, 7:15:47 PM9/24/16
to puppet...@googlegroups.com
Hi Guys,

I am new to hiera and can't seem to get the debug command to work for hiera.  Seems like it is not picking up the environment variable even when I specify it on cli:

--
[root@resforetst01 ~]# grep -i testkey /etc/puppet/environments/production/hieradata/common.yaml
testkey: hello

[root@resforetst01 ~]# hiera -c /etc/puppet/hiera.yaml testkey environment=production --debug
DEBUG: 2016-09-24 16:10:28 -0700: Hiera YAML backend starting
DEBUG: 2016-09-24 16:10:28 -0700: Looking up testkey in YAML backend
DEBUG: 2016-09-24 16:10:28 -0700: Looking for data source common
DEBUG: 2016-09-24 16:10:28 -0700: Cannot find datafile /etc/puppet/environments//hieradata/common.yaml, skipping
nil

[root@resforetst01 ~]# grep -i datadir /etc/puppet/hiera.yaml | grep -v '#'
  :datadir: "/etc/puppet/environments/%{::environment}/hieradata"

[root@resforetst01 ~]# cat /etc/puppet/environments/production/hieradata/common.yaml | grep -v '#' | sed '/^$/d'
---
pr_runlevel::default_runlevel: '3'
selinux::mode: 'disabled'
firewall::ensure: 'stopped'
testkey: hello
--

Any help would be appreciated.  Am I missing some configuration here?

Thanks!

Rob Nelson

unread,
Sep 24, 2016, 7:42:58 PM9/24/16
to puppet...@googlegroups.com
Use ::environment on the command line, since that's what your datadir is looking for. environment and ::environment are not normalized to the same value. 
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAKyjK53nAWV6G9RPK7G4OGcV%3DvpEU%3DmQ6TpoA0bGu6ZLp5GXsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--

Jagga Soorma

unread,
Sep 26, 2016, 12:22:04 AM9/26/16
to Puppet Users
Thanks for the reply Rob. That seemed to be the problem.
Reply all
Reply to author
Forward
0 new messages