Hiera is able to read yaml files based on facts, .e.g. if facter domain returns dev.example.com and a dev.example.com.yaml file exist the file is read and the key-values are used. Using hiera can reduce the number of Puppet code lines.
Questions tagged [hiera]
83 questions
3
votes
2 answers
Pass same parameter value to multiple classes using Puppet Hiera
I'm using Hiera with Puppet and I want to pass the same parameter value to multiple classes without repeating it. Right now I've got (in Yaml):
---
class_a::database_server: myoraclebox.example.com
class_b::database_server:…

Rob H
- 629
- 1
- 7
- 15
3
votes
0 answers
Puppet/Hiera: Error 400 on SERVER: undefined method `empty_answer' for Hiera::Backend:Module
I had a puppet master running for quite some time. After a restart of the process recently, I started getting:
# puppet agent -t
info: Retrieving plugin
info: Loading facts in /var/lib/puppet/lib/facter/mountpoints.rb
info: Loading…

Kristian Øllegaard
- 131
- 2
3
votes
2 answers
How to exclude Puppet modules for a few nodes?
I have 80 nodes, 78 need to have a specific module, except for 2.
[root@puppetmaster puppet]# cat hiera.yaml
:backends:
- yaml
:hierarchy:
- environment/%{::environment}/%{::hostname}
- environment/%{::environment}
-…

ujjain
- 3,983
- 16
- 53
- 91
2
votes
1 answer
How do I conditionally enable a managed repo using puppet-yum?
The puppet-yum documentation is very straightforward, and explains how to add your own managed repo via hiera data. However, in addition to our 'release' repo, I want to conditionally add our 'build' repo to servers in our 'test' environment.
In a…

Cory Ringdahl
- 141
- 4
2
votes
1 answer
how to make our servers aware of the names of the other servers in the environment in Puppet
Can you please guide me on how I can use hiera or site.pp to make our servers aware of the names of the other servers in the environment?
for example ,
we have 10 servers in uat2 ,Id like to get a list of them into puppet such that the servers know…

Sam S
- 21
- 1
2
votes
1 answer
Puppet and systemctl trouble
I have some trouble with puppet and systemctl. I used to load several parameters for a 'service' but it's not working anymore on centos7.
This is my error:
Error: Could not enable [ntpd ntpdate]:
Error: /Stage[main]/Ntp::Service/Service[[ntpd…

Skullone
- 195
- 1
- 1
- 11
2
votes
2 answers
Vagrant Puppet apply manifest with wrong environment
I use Puppet 3.7 in standard client-server mode, with environments, and using Hiera for data.
I use Vagrant to test the Puppet manifests directly from my Puppet repository.
I recently started to use Hiera and changed my Vagrantfile (and Vagrant…

daks
- 673
- 7
- 25
2
votes
2 answers
Using hiera to access facts of another node
What we're trying to do is generate firewall rules (puppetlabs/firewall) for iptables. Our nodes are grouped like so conceptually:
-- site1
---- shared1
------ specific1
------ specific2
---- shared2
------ specific3
------ specific4
The node…

Josh Smeaton
- 1,340
- 2
- 19
- 31
1
vote
1 answer
Puppet parse hiera in inline_template
I have got some .yaml hiera file with:
iptables::test:
ip:
1.1.1.1 : 'adm-1'
2.2.2.2 : 'adm-2'
3.3.3.3 : 'adm-3'
And i want to parse this file in inline_template. I write:
$variable1 = hiera('iptables::test.ip')
$variable2 =…

perrfect
- 65
- 1
- 7
1
vote
0 answers
Overriding Puppet class parameters with hiera
Im trying to use heira to override class parameters in puppet.
I have this class:
class test(
$parameter1="codeddefault"
)
{
notify {"parameter1 is $parameter1": }
}
This is my hiera.yaml:
---
version: 5
defaults:
# The default value for…

GeoSword
- 1,657
- 12
- 16
1
vote
0 answers
Module not executing with r10k/puppet on masterless system
I was following this guide to set up a masterless puppet machine that could use puppet to manage itself (in a way that would let me add nodes and use this as the master later, but that's irrelevant now). And I have a basic module set up that should…

cclloyd
- 593
- 2
- 14
- 29
1
vote
1 answer
Using Foreman's host groups in hiera.yaml :hierarchy section
Does anyone know how to set a correct path in :hierarchy section of hiera.yaml config to apply configuration to Foreman's host groups? I tried to use this settings with %{::hostgroup} variable, but it didn't work for me:…

patok
- 692
- 1
- 5
- 15
1
vote
1 answer
Get array output in puppet ERB from hiera
I have a array defined in the following format in hiera.
master_servers:
- "stage-01.com"
- "stage-02.com"
I am trying to populate the config file with ERB in the following format
discovery.zen.ping.unicast.hosts: ["stage-01.com",…

nitins
- 2,579
- 15
- 44
- 68
1
vote
1 answer
Managing Puppet certnames with dynamic servers
I have a puppet setup where each node manifest is named something like
/^web-\d+\.example\.com$/
We do this so we can spin up new servers for additional capacity and give each one a unique certname using the timestamp from when it was…
user321848
1
vote
0 answers
Hiera lookup of datasource failing on new node
I'm trying to set up a new node using puppet, but it fails with an error that leads me to believe that hiera isn't finding the correct datasource:
Server Error: Evaluation Error: Error while evaluating a Function Call, undefined method `empty?' for…

Christoph Gösgens
- 21
- 1
- 7