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

Plan lookup: Could not find class

When running a Puppet plan that uses lookup{} function against Hiera I get the error: The target node: 'computer1.domain.com' errored with a message: Internal Server Error: org.jruby.exceptions....
user avatar
  • 203
1 vote
1 answer
183 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 ...
user avatar
  • 11
1 vote
1 answer
201 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: $...
user avatar
2 votes
1 answer
211 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' ...
user avatar
0 votes
1 answer
798 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 ...
user avatar
0 votes
1 answer
804 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 ...
user avatar
0 votes
1 answer
172 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 ...
user avatar
0 votes
1 answer
367 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: ...
user avatar
0 votes
1 answer
1k 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 ...
user avatar
  • 131
0 votes
2 answers
1k 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 ...
user avatar
  • 1,336
0 votes
1 answer
211 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 ...
user avatar
  • 1
1 vote
0 answers
1k 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: ...
user avatar
  • 1,637
0 votes
1 answer
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 ...
user avatar
1 vote
0 answers
253 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 ...
user avatar
  • 613
1 vote
1 answer
836 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 ...
user avatar
  • 683
1 vote
1 answer
809 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....
user avatar
  • 2,517
0 votes
1 answer
370 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::...
user avatar
  • 21
1 vote
1 answer
67 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 ...
user avatar
2 votes
1 answer
28 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 ...
user avatar
  • 21
0 votes
1 answer
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 --...
user avatar
  • 1
1 vote
0 answers
400 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 ...
user avatar
0 votes
1 answer
743 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, }...
user avatar
  • 584
0 votes
2 answers
783 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 ...
user avatar
  • 195
1 vote
1 answer
76 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 ...
user avatar
2 votes
1 answer
386 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]: ...
user avatar
  • 195
5 votes
1 answer
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 ...
user avatar
  • 5,691
1 vote
1 answer
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 ...
user avatar
  • 145
0 votes
1 answer
219 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. ...
user avatar
  • 3,113
1 vote
1 answer
485 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: "%{::...
user avatar
  • 11
0 votes
1 answer
113 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 --...
user avatar
  • 5,746
1 vote
0 answers
121 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] ...
user avatar
2 votes
2 answers
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 ...
user avatar
  • 673
-2 votes
1 answer
311 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('...
user avatar
1 vote
1 answer
966 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}/%{...
user avatar
  • 722
3 votes
1 answer
3k 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] - ...
user avatar
0 votes
1 answer
174 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': ...
user avatar
10 votes
3 answers
8k 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....
user avatar
  • 905
3 votes
1 answer
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 ...
user avatar
  • 905
0 votes
1 answer
289 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 ...
user avatar
  • 357
0 votes
1 answer
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 ...
user avatar
  • 10.4k
0 votes
1 answer
784 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 ...
user avatar
0 votes
0 answers
477 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 ...
user avatar
  • 473
1 vote
2 answers
3k 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 ...
user avatar
  • 913
4 votes
1 answer
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 ...
user avatar
1 vote
0 answers
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 ...
user avatar
1 vote
2 answers
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 ...
user avatar
  • 133
-3 votes
1 answer
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: ...
user avatar
  • 9
0 votes
1 answer
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 ...
user avatar
  • 10.4k
1 vote
1 answer
1k 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 ...
user avatar
  • 10.4k
0 votes
1 answer
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 ...
user avatar
  • 193