Puppet Config file synatx Hiera yaml

0 votes
Can somebody explain the config file syntax, i actually wanted to include a few configurations in hiera.yaml file?
Aug 28, 2019 in Puppet by Lilly
1,571 views

1 answer to this question.

0 votes

Config file syntax:

The hiera.yaml file is a YAML file, containing a hash with up to four top-level keys.

The following keys are in a hiera.yaml file:

  • version - Required. Must be the number 5, with no quotes.

  • defaults - A hash, which can set a default datadir, backend, and options for hierarchy levels.

  • hierarchy - An array of hashes, which configures the levels of the hierarchy.

  • default_hierarchy - An array of hashes, which sets a default hierarchy to be used only if the normal hierarchy entries do not result in a value. Only allowed in a module's hiera.yaml.

version: 5 
defaults: # Used for any hierarchy level that omits these keys. 
datadir: data # This path is relative to hiera.yaml's directory. 
data_hash: yaml_data # Use the built-in YAML backend. 
hierarchy: 
- name: "Per-node data" # Human-readable name. 
path: "nodes/%{trusted.certname}.yaml" # File path, relative to datadir. # ^^^ IMPORTANT: include the file extension! 
- name: "Per-datacenter business group data" # Uses custom facts. 
path: "location/%{facts.whereami}/%{facts.group}.yaml" 
- name: "Global business group data" 
path: "groups/%{facts.group}.yaml" 
- name: "Per-datacenter secret data (encrypted)" 
lookup_key: eyaml_lookup_key # Uses non-default backend. 
path: "secrets/%{facts.whereami}.eyaml" 
options: 
pkcs7_private_key: /etc/puppetlabs/puppet/eyaml/private_key.pkcs7.pem 
pkcs7_public_key: /etc/puppetlabs/puppet/eyaml/public_key.pkcs7.pem 
- name: "Per-OS defaults" 
path: "os/%{facts.os.family}.yaml" 
- name: "Common data" 
path: "common.yaml" 
answered Aug 28, 2019 by Sirajul
• 59,230 points

Related Questions In Puppet

0 votes
1 answer
0 votes
2 answers

Where do i find the puppet configuration file?

The puppet.conf file is always located at $confdir/puppet.conf. Although ...READ MORE

answered Aug 9, 2019 in Puppet by Sirajul
• 59,230 points
1,981 views
0 votes
1 answer

Vagrant file to bring up VM using Puppet

You vagrant file should look something like ...READ MORE

answered Mar 12, 2019 in Puppet by Barbara
749 views
0 votes
1 answer

What is Hiera in puppet and what does it do?

Hiera is probably a built-in key-value configuration data ...READ MORE

answered Jul 25, 2019 in Puppet by Sirajul
• 59,230 points
4,546 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,516 views
+2 votes
1 answer
0 votes
1 answer

Puppet+Docker: How do i configure my docker container to use a NFS volume through a Hiera config file?

If using Hiera, configure the docker::volumes class in the ...READ MORE

answered Aug 14, 2019 in Puppet by Sirajul
• 59,230 points
734 views
0 votes
1 answer

Puppet: Loaction of Hiera.yaml file in puppet.

The Hiera configuration file is called hiera.yaml. It configures the ...READ MORE

answered Aug 28, 2019 in Puppet by Sirajul
• 59,230 points
589 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP