Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

puppet looking for hiera.yaml in the wrong place

Tags:

vagrant

puppet

I want puppet to look for hiera.yaml in /etc but it's looking for it in /etc/puppet. I put a line into puppet.conf:

hiera_config = /etc/hiera.yaml

But still gives me the hiera.yaml update warning when I run the script.

I'm running the script from Vagrant 1.2.2. Using puppet 3.2.2

I'm running Centos 6.4 in a vm.

like image 272
creftos Avatar asked Dec 20 '22 02:12

creftos


2 Answers

I found that the puppet provisioner in vagrant now support hiera_config_path which does exactly what is desired.

config.vm.provision :puppet do |puppet|
  # path on host machine to hiera.yaml
  puppet.hiera_config_path = '/Users/me/vms/hiera/hiera.yaml'
  # This sets the relative path for hiera data directories
  puppet.working_directory = '/Users/me/vms/hiera'
end

This is documented in Vagrant: Up and Running but I didn't find it until I started looking into the vagrant source to implement this feature myself.

like image 89
ivanlei Avatar answered Jan 24 '23 05:01

ivanlei


Hmmm... On Vagrant 1.2.2 and Puppet 3.2.3, I am able to set hiera_config in puppet.conf without problems. I would double-check that you are editing /etc/puppet.conf on the Vagrant vm, not on the host machine, and that the hiera_config line is the [main] block, not just in the [master] block.

If both of those conditions are true and it is still not working, you might try explicitly setting hiera_config in your Vagrantfile:

config.vm.provision :puppet do |puppet|
  ...
  puppet.options = '--hiera_config=/etc/hiera.yaml'
end

Good luck!

like image 28
choover Avatar answered Jan 24 '23 05:01

choover