Questions tagged [hiera]

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.

82 questions
10
votes
3 answers

How to reference a hiera variable from elsewhere the hierarchy?

So suppose in a very specific hiera YAML file I define a variable, such as "env_name". env_name: "dev-unstable" Now in a more general hiera file I'd like to interpolate that variable into a string. server_name:…
Mojo
  • 925
  • 1
  • 9
  • 24
10
votes
4 answers

How to set up :datadir: when using Hiera with Puppet and Vagrant

I'd like to know how to set up :datadir: in hiera.yaml for optimal usage with Puppet and Vagrant. Currently I'm using vagrant 1.5.0 with virtualbox 4.2 on Ubuntu 13.10 with an Ubuntu 12.04 guest running puppet 3.1.1 I am trying to set up an…
greg_1_anderson
  • 291
  • 1
  • 2
  • 6
7
votes
2 answers

Hiera lookup based on pattern

I am trying to wrap my head around how I can transition from something I am doing in my large site.pp file into a structure I can use in hiera. It isn't clear to me from reading the puppet docs, exactly how the hiera data is evaluated and when it…
Zoredache
  • 128,755
  • 40
  • 271
  • 413
7
votes
1 answer

Verifying hiera lookup for puppet

In the course of attempting to debug my puppet manifests numerous times after bundling it with hiera, sometimes I doubt whether the correct hiera lookup is even being performed. I am mostly using CentOS with Puppet 3. Is there any tool I can use to…
xiankai
  • 173
  • 1
  • 4
6
votes
2 answers

Puppet&Hiera: $variable is not an hash or array when accessing it

I was using Puppet 3.2.2 and Hiera 1.2.1. And I wrote a puppet module and the content of init.pp was: class install( $common_instanceconfig = hiera_hash('common_instanceconfig'), $common_instances = hiera('common_instances') ) { define…
txworking
  • 479
  • 2
  • 6
  • 15
5
votes
1 answer

What is the equivalent of using hiera as an ENC in Ansible?

I use hiera as an External Node Classifier in Puppet in order to avoid that roles are deployed on nodes that are for example incompatible. Now I have two servers that are provisioned using Ansible. I am concerned that when the cluster grows that I…
030
  • 5,731
  • 12
  • 61
  • 107
5
votes
4 answers

hiera_include equivalent for resource types

I'm using the yumrepo built-in type. I can get a basic integration to hiera working yumrepo { hiera('yumrepo::name') : metadata_expire => hiera('yumrepo::metadata_expire'), descr => hiera('yumrepo::descr'), gpgcheck =>…
quickshiftin
  • 2,025
  • 5
  • 27
  • 41
5
votes
1 answer

hiera data source in using puppet syntax?

The documentation for hiera on docs.puppetlabs.com seems to give me the impression that I can use puppet syntax to describe my data. Or posssibly will be able to in the future. See: Coming soon. Is this functionality present in a release version…
Zoredache
  • 128,755
  • 40
  • 271
  • 413
4
votes
1 answer

Satellite 6's puppet is unable to find the hiera data sources

Using Satellite 6 which comes with Foreman 1.6.0.53. By default, Puppetlabs' documentation states that hiera configuration should be in $config/hiera.yaml. # puppet config print confdir hiera_config confdir = /etc/puppet hiera_config =…
Belmin Fernandez
  • 10,629
  • 26
  • 84
  • 145
4
votes
1 answer

Trouble using hiera in masterless setup and getting values set for classes

I am running a masterless puppet setup that applies the puppet changes in the following manner. puppet apply /tmp/puppet/manifests/site.pp --modulepath=/tmp/puppet/modules --hiera_config=/tmp/puppet/hiera.yaml I have been trying to work in hiera to…
Wilshire
  • 538
  • 6
  • 19
4
votes
1 answer

Puppet reporting without master

I am planning a Puppet infrastructure for about 100-200 servers. This is the design so far: Stash (git) for storing puppet config (not planning on using a master). Hiera to query either yaml, json, or possibly couchdb for sensitive (passwords)…
Progger
  • 253
  • 2
  • 5
3
votes
1 answer

how to create array of arrays from hiera in puppet

I have a situation where I have to generate array of arrays which are declared in hiera in puppet at different hierarchies. Lets say at environment level I have a declaration test: - [a,b,c,d] - [e,f,g,h] and at common.yaml I have a declaration…
Arijit Ghosh
  • 31
  • 1
  • 3
3
votes
1 answer

How do I run hiera standalone to test values?

Presumably on my puppet master I can run hiera from the command line to see how a particular node would generate a variable set, but it's really hard to find a working example of that. I've tried using the puppet inventory and using mcollective,…
Mojo
  • 925
  • 1
  • 9
  • 24
3
votes
1 answer

Different hiera hierarchy per dynamic environment

Is it possible to define a separate hiera.yaml for a given environment? Currently I am using dynamic environments. Each one has its own hiera data directory, per my hiera.yaml file. :yaml: :datadir: /var/lib/hiera/%{environment} One drawback…
quickshiftin
  • 2,025
  • 5
  • 27
  • 41
3
votes
2 answers

Manage enable - disable nginx site by Hiera puppet?

i got the task to implement hiera puppet script to manage sites_enabled for nginx. Here is my puppet script: common.yaml --- classes: - nginx nginx: enabled: abc.com xyz.com disabled: test.com …
Calvin Pham
  • 55
  • 1
  • 4
1
2 3 4 5 6