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.

Filter by
Sorted by
Tagged with
1
vote
1answer
37 views

Puppet Class Lookup from Hiera with Automated Chaining

I am using hiera with puppet and have a puppet role/profile setup, where 1 role includes multiple profiles (as shown below). My build role includes hardcoded profiles with a number of chains at the ...
1
vote
1answer
44 views

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: $...
2
votes
1answer
45 views

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' ...
0
votes
1answer
152 views

Puppet : call define type in class from hiera

I would like to create install_package module which can be called multi times, where packages are defined in hiera. I know class is skelton (can be called one time), and define type is designed for my ...
0
votes
1answer
289 views

puppet best practices: share variables among profiles

I'm using the roles&profiles approach for my current puppet project. The puppet best practices tell me: Expose all necessary profile parameters in the main class parameter list. Perform hiera ...
0
votes
1answer
76 views

create textfile in puppet from hiera list

I have a hash with a list in hiera. I use this to automatically create the dbs in the RDBMS via create_resources dbs: - dbname: something - dbname: or - dbname: other I would like to use this ...
0
votes
1answer
133 views

puppet 6 template variable from hiera can't be retreived

I'm having problem when migrating the puppet code from puppet 3 to puppet 6. This is the error message: Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: ...
0
votes
1answer
617 views

How do you test/troubleshoot hiera in a Puppet environment

I'm using Puppet alongside Foreman to provision hosts, and I've currently got all of Puppet config as modules in a repository. I'd like to use Hiera but I've never been able to get even the simplest ...
0
votes
2answers
498 views

Q: How to define Apache modules via Puppet and Hiera?

I am currently using Puppet with Foreman 1.17 and puppetlabs/apache version 3.1.0. All virtual hosts are defined using a .yaml file: apache::vhost: vm12345_ssl: servername: my.example.com ...
0
votes
1answer
134 views

Puppet 5 : Variables not interpolated

I'm trying to update an old Puppet 3 infrastructure to Puppet 5. I'm using Hiera to get the data, with a NoSQL backend. I've written my own ENC in order to get node data from there, and this is ...
1
vote
0answers
548 views

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: ...
0
votes
1answer
1k views

Encrypting properties with “eyaml edit” without a private key?

I would like to use eyaml edit to edit my Puppet/Hiera configuration files. My configuration files are a mixture of encrypted and plain text content. I want to use eyaml edit to encrypt certain ...
1
vote
0answers
188 views

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 ...
1
vote
1answer
585 views

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 ...
1
vote
1answer
672 views

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....
0
votes
1answer
257 views

dynamic values inside hiera classes

below is my common.yaml file --- classes: - home_setup::falcon_logical_name home_setup::falcon_logical_name::user: 'falcuat' home_setup::falcon_logical_name::group: 'falcgrp' home_setup::...
1
vote
1answer
58 views

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 ...
2
votes
1answer
27 views

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 ...
0
votes
1answer
1k views

Puppet not pulling Hiera value

Learning Puppet and Hiera and I've run into a roadblock. I apologize in advance if this is something simple. Given the following files within my GitLab for the PuppetClass es_strat: hiera.yaml --...
1
vote
0answers
268 views

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 ...
0
votes
1answer
405 views

how do create puppet file directory resource using variable in the name so that it does not add brackets around the name []

When I try the following in my manifest. $profile = hiera('duplicity::profile', 'test123') file { [ "/tmp/${profile}" ]: ensure => directory, owner => root, group => root, } I ...
0
votes
2answers
678 views

Puppet/hiera : generate sereval files from one template

I'm running puppet 4 and I would like to generate several config files from the same template with different configurations for each one. for example : # cat /tmp/a.conf test1 # cat /tmp/b.conf ...
1
vote
1answer
71 views

Does Puppet 2.7 allow a class inheritance of an unparameterized “params” class?

I'm getting the following error when I run puppet-lint: $ puppet-lint manifests/* manifests/init.pp - WARNING: class inheriting from params class on line 72 I had myself a quick search on ...
2
votes
1answer
325 views

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]: ...
5
votes
1answer
1k views

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 ...
1
vote
1answer
2k views

Best way for user management with Hiera

I am currently trying to move our Puppet setup to further use Hiera. In regard to this, I would like to create the users with Hiera, but having some problems how to do this when moving up in the ...
0
votes
1answer
208 views

RedHat Satellite/Katello and Hiera

I'm using RedHat Satellite 6.1.1, and am successfully syncing Puppet modules from a local forge into the Katello part of Satellite. However, I'm not sure how to go about syncing my Hiera data. ...
1
vote
1answer
399 views

Getting puppetlabs-apt module apt::ppa working in puppet hiera

I'm using the puppetlabs-apt forge module together with hiera in puppet 3.8.5. Adding apt::sources works: apt::sources: 'ubuntu': location: 'http://server.com/ubuntu' release: "%{::...
0
votes
1answer
95 views

failing to look up hiera-file value from puppet

I'm in the process of upgrading an old puppet 2.7 installation to puppet 3.8, and I've also been shuffling the location of some of hiera's data. I'm not sure which is to blame here. puppet agent --...
1
vote
0answers
113 views

hiera_hash/hiera_array in foreman?

Is there a way in foreman to have puppet variables appended from parent host groups? Example of desired functionality: AllHosts: ssh_allow[10.1.1.0/32] AllHosts/publicHosts: ssh_allow[71.0.0.0/8] ...
2
votes
2answers
1k views

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 ...
-2
votes
1answer
284 views

Return yaml value to puppet fact lookup

I'm trying to resolve a YAML value in a module file { '/boot/config.txt' : ensure => present, mode => '0755', content => $::hostname?{ 'serverName1.domain' => template('...
1
vote
1answer
661 views

Load hiera file from specific variable/fact/hiera-value

I'm trying to load a hiera file according to a specific flag. Hiera hierarachy configuration is :hierarchy: - "%{environment}/%{::fqdn}" - "%{environment}/%{nodetype}" - "%{environment}/%{...
2
votes
1answer
2k views

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] - ...
0
votes
1answer
165 views

Puppet - using hiera parameters in a top scope manifest file

I have a site.pp file which looks like this: Package {allow_virtual => false,} stage { 'pre': before => Stage['main'] } stage { 'post': require => Stage['main'] } resources { 'firewall': ...
7
votes
2answers
5k views

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....
3
votes
1answer
1k views

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 ...
0
votes
1answer
258 views

Using hiera to include modules in example42/apache

I'm trying to set up a puppet configuration for work (open source version), and my goal is to create a sort of standard class that most of our servers could just use with a simple hiera_include in the ...
0
votes
1answer
1k views

Puppet: How to fix “Unknown function hiera_include”?

I've installed Puppet using the foreman-installer and it installed successfully. Then, I wanted to install Hiera as I have some modules which use hiera functions so I've installed hiera and created a ...
0
votes
1answer
736 views

Disable Puppet ENC part in Foreman

I looked for this for days now, and I'm quite depressed. We want to use Foreman as a monitoring and provisionnig tool. We would like to deactivate Foreman's ENC and use only Hiera. How could I manage ...
0
votes
0answers
385 views

How do dynamically get the hostname of another machine in hiera?

I have a few machines, one of those has the class dbserver assigned via ENC. The other machines run software which need the DB. Now I want to configure this software to be able to connect to the DB. I ...
1
vote
2answers
2k views

Optionally pass parameter to puppet using hiera

We're using the roles/profiles pattern. In the example below I'd like to optionally pass a parameter from hiera so that if no value is provided then the ::apache class default is used (which it gets ...
4
votes
1answer
1k views

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 ...
1
vote
0answers
2k views

Puppet node no picking up hiera parameter from global.yaml file

I am using Foreman, Puppet and Hiera to provide parameter data for my nodes. Each node has its own node.yaml file on the Puppet Master in /etc/puppet/hieradata. There is also a global.yaml file ...
1
vote
2answers
2k views

Get value from hiera hash in Puppet

I have this structure in my hiera file that create some rules in my smb.conf. samba::shares: PDF: - comment = "PDF" - path = /home/smb/pdf - browseable = yes - hide dot files = yes ...
-3
votes
1answer
1k views

Puppet noob, stuck on the same error for hours

I'm trying to setup a puppet master with hiera. When I try "puppet agent --test" on the mongo node I get this error. Error: Could not retrieve catalog from remote server: Error 400 on SERVER: ...
0
votes
1answer
2k views

Linux-Puppet: Error: Could not retrieve catalog from remote server, what could be the reason?

I've wrote a Puppet module which is supposed to create a directory, copy files into there and change the ownership of the files. The module name is "workspace". In the manifests folder of the module ...
1
vote
1answer
979 views

Puppet module not run on agents while this has been defined in Hiera on the Puppetmaster

Once I've installed Puppet, Foreman, Hiera and Facter, how do I get them all to work with one another? The Foreman GUI is operating properly and can be viewed using a browser. Hiera is installed, and ...
0
votes
1answer
6k views

How to return default hash keys in hiera_hash() call?

In an attempt to clean up my client's Hiera data for Puppet, and drastically reduce the number of Hiera calls in the Puppet manifests, I'm changing constructs like some_name::key1: a_value_1 ...
1
vote
1answer
948 views

How to instantiate multiple instances of the same resource using Hiera

Using Hiera, is it possible to instantiate two classes with different properties? I know I can do add to my node declaration: user{'francois': uid => 1000, # ... } user{'julien': uid => ...