How can I use "puppet apply" with hiera?

10,512 views
Skip to first unread message

Campee

unread,
May 29, 2013, 7:06:34 PM5/29/13
to puppet...@googlegroups.com
I'm running Puppet v2.7.14. I have a puppet master server with Hiera and it works great. I also want to be able to apply my manifests locally on a node. I have installed Hiera on my node and I can verify using the Hiera command line application that values can be looked up:

user@tag5-4-qa-sjc:~$ hiera corp_puppet_server region=northamerica datacenter=sjc environment=qa --debug
DEBUG: Wed May 29 16:03:46 -0700 2013: Hiera YAML backend starting
DEBUG: Wed May 29 16:03:46 -0700 2013: Looking up corp_puppet_server in YAML backend
DEBUG: Wed May 29 16:03:46 -0700 2013: Looking for data source regions/northamerica/datacenters/sjc/qa/qa-sjc
DEBUG: Wed May 29 16:03:46 -0700 2013: Found corp_puppet_server in regions/northamerica/datacenters/sjc/qa/qa-sjc
puppet-qa-sjc.corp.net

But when I run puppet I get an error saying that a value can not be looked up:

user@tag5-4-qa-sjc:~$ sudo puppet apply --pluginsync --modulepath=/home/user/puppet/modules/ /home/user/puppet/manifests/site.pp

Failed to parse template puppet/puppet_run.sh.erb: Could not find value for 'corp_puppet_server' at 2:/home/user/puppet/modules/puppet/templates/puppet_run.sh.erb at /home/user/puppet/modules/puppet/manifests/init.pp:17 on node tag5-4-qa-sjc.corp.net

Vlad

unread,
May 29, 2013, 7:18:47 PM5/29/13
to puppet...@googlegroups.com
I use the following:
sudo puppet apply --pluginsync --hiera_config /path/to/hiera.yaml --modulepath=/home/user/puppet/modules/ /home/user/puppet/manifests/site.pp

Campee

unread,
May 29, 2013, 7:24:56 PM5/29/13
to puppet...@googlegroups.com
--hiera_config is an invalid option for the version of puppet that I'm using. I must need a newer version..

Campee

unread,
May 29, 2013, 7:46:51 PM5/29/13
to puppet...@googlegroups.com
Upgrading my version of puppet fixes the issue, I guess I'll just do that.

On Wednesday, May 29, 2013 4:06:34 PM UTC-7, Campee wrote:
Reply all
Reply to author
Forward
0 new messages