Questions tagged [hiera]

Hiera is a key/value lookup tool for configuration data for the Puppet configuration management tool.

Hiera is a key/value lookup tool for configuration data for the Puppet configuration management tool.

It is built for the Puppet configuration management toolkit. It allows a separation of concerns by allowing you to leverage data for manifests, allowing you to keep the code separate from the data in Puppet manifests.

Links:

Related Tags

259 questions
14
votes
2 answers

Hiera command line: How do I view all data in the hierarchy for a given node?

just testing out hiera and I'd like to be able to view all the available data (variable=value pairs) in the hierarchy for a given node. My Hiera hierarchy is configured as: --- :backends: - yaml - json :yaml: :datadir:…
Dave F
  • 180
  • 1
  • 1
  • 8
11
votes
3 answers

Puppet hiera equivalent in Ansible

hiera.yaml --- :hierarchy: - node/%{host_fqdn} - site_config/%{host_site_name} - site_config/perf_%{host_performance_class} - site_config/%{host_type}_v%{host_type_version} - site/%{host_site_name} - environments/%{site_environment} -…
MavWolverine
  • 846
  • 1
  • 9
  • 24
7
votes
1 answer

Access hiera scope from Puppet custom type

I'm building a custom type and I'm unable to get access to the hiera scope from a defaultto block module Puppet require 'puppet/parser/functions/hiera' newtype(:my_type) do ensurable newparam(:myparam) do defaultto {…
Raul Andres
  • 3,766
  • 15
  • 24
6
votes
2 answers

How can I split my hiera config by role?

I'm using hiera to assign classes like webserver or dbserver to my nodes. The webserver class just includes apache and sets some config on it (e.g. port). Obviously I don't want to replicate this config for every node, so I put it in common.yaml.…
stripybadger
  • 4,539
  • 3
  • 19
  • 26
5
votes
2 answers

Complex hiera lookup not working

I have the following definition in a yaml file: keepalived: cluster_name: "cluster.example.lan" cluster_ip: "192.168.1.10" cluster_nic: "eth0" haproxy: bind_address: %{hiera('keepalived::cluster_ip')} And as a result in bind_address…
Stanislav
  • 73
  • 1
  • 7
5
votes
1 answer

How do I read a Hiera value from a Puppet function?

I have to write a function that will, in order, perform the following to read the value of a variable: Check if there is a facter variable defined. If not, Read the value of the variable from Hiera. If not, Use a default value. I have managed to…
Siddhu
  • 888
  • 3
  • 9
  • 28
4
votes
1 answer

unable to puppet lookup a hiera interpolated hash

getting a string instead of array this is my common.yaml aa::params: - '--params:"abc.com' - 'abc2.com' test::packages: package1: ensure:'present' install_options: "%{lookup('aa:params')}" this is my manifest file $packages =…
4
votes
2 answers

Remove value from hash Puppet

I have the following params in hiera: base::users: john@example.com: ensure: present user: john sudo: true type: ssh-rsa key: AAAAB3NzaC1yc2EAAAABJ in puppet i'm getting the following hash: {john@example.com => {ensure =>…
aRTURIUS
  • 1,230
  • 2
  • 13
  • 31
4
votes
1 answer

Iterate over a deeply nested hiera hash in puppet manifest

I'm working on building a structure for my webservers. I have my setup in hiera, but I can't seem to get puppet to give back the correct types. In common.yaml vhosts: hostname: sitename: app_url: value app_type: value I have…
h3r2on
  • 379
  • 1
  • 3
  • 12
4
votes
0 answers

Puppet clients applying empty classes (with default parameters)

The problem: Servers running puppet agent in my environment are receiving empty [classes] (without parameters), instead of the expected parameters stored in their Hiera document. This causes puppet modules to run with null parameters which in turn…
Oz Bar-Shalom
  • 1,747
  • 1
  • 18
  • 33
4
votes
2 answers

setting environment in puppet

Being new to Puppet, I'm stuck at a place where I want to set environment ( production, test, dev ) in Puppet. Specifically, I have an Hiera file where I have defined some data. Now I want to provide environment-specific values for some Hiera keys.…
Yogesh Jilhawar
  • 5,605
  • 8
  • 44
  • 59
4
votes
1 answer

Puppet - Using node scope variables in Hiera config

I'm trying to use a node scope variable in my hiera.yaml config, which apparently should be relatively simple, but it's just not working for me Lol With the hiera.yaml like this: --- :backends: - yaml :yaml: :datadir:…
Just Lucky Really
  • 1,341
  • 1
  • 15
  • 38
4
votes
1 answer

Can I use hiera with a YAML backend to combine arrays?

I'm using hiera with a YAML backend to manage my Puppet configuration and I'd like to append some values to an array. I have a configuration file which looks a bit like this: --- some_config: - one - two - three some_more_config: - one -…
alexmuller
  • 2,207
  • 3
  • 23
  • 36
4
votes
2 answers

Do basic math inside Hiera

I'm trying to set a crontab's weekday in hiera based on a custom fact and a basic modulo but I can't even figure out if it's possible. I'd like to do something like: cron-job: command: "do something" user: myuser hour: …
jercra
  • 394
  • 6
  • 18
3
votes
1 answer

using multiple hiera.yaml files with puppet

after the introduction of Debian to our infrastructure as an OS for hardware as well as for VM's in our Ganeti environment, I am trying now to deploy apt sources lists for Debian hosts by using a local hiera.yaml file within the module it self. We…
Max
  • 543
  • 6
  • 17
1
2 3
17 18