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
1 answer
105 views

How to use puppet-apache mod (v8.3.0) with hiera?

Queston: Using the roles & profiles method, is it possible to use 'puppetlabs-apache', '8.3.0' with a hiera lookup? Context: I am using mod 'puppetlabs-apache', '8.3.0' to configure an apache ...
John-H's user avatar
  • 11
0 votes
1 answer
193 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....
woter324's user avatar
  • 233
1 vote
1 answer
332 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 ...
douggdx's user avatar
  • 11
1 vote
1 answer
418 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: $...
perrfect's user avatar
2 votes
1 answer
340 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' ...
Cory Ringdahl's user avatar
0 votes
1 answer
1k 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 ...
Colas06's user avatar
0 votes
1 answer
1k 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 ...
C.Scharfenberg's user avatar
0 votes
1 answer
236 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 ...
Christoph Gösgens's user avatar
0 votes
1 answer
489 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: ...
Diamond's user avatar
0 votes
1 answer
2k 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 ...
geoffjay's 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 ...
nn4l's user avatar
  • 1,336
0 votes
1 answer
259 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 ...
drksnw's 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: ...
GeoSword's user avatar
  • 1,657
0 votes
1 answer
2k 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 ...
Mark McLaren's user avatar
1 vote
0 answers
289 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 ...
cclloyd's user avatar
  • 593
1 vote
1 answer
1k 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 ...
patok's user avatar
  • 692
1 vote
1 answer
1k 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....
nitins's user avatar
  • 2,589
0 votes
1 answer
473 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::...
Sam S's user avatar
  • 21
1 vote
1 answer
71 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
30 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 ...
Sam S's user avatar
  • 21
0 votes
1 answer
2k 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 --...
Tronyx's user avatar
  • 1
1 vote
0 answers
500 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 ...
Christoph Gösgens's user avatar
0 votes
1 answer
1k 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, }...
nelaaro's user avatar
  • 644
0 votes
2 answers
905 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 ...
Skullone's user avatar
  • 195
1 vote
1 answer
85 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 ...
Nathan Basanese's user avatar
2 votes
1 answer
443 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]: ...
Skullone's user avatar
  • 195
5 votes
1 answer
2k 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 ...
030's user avatar
  • 5,941
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 ...
Hellstorm's user avatar
  • 145
0 votes
1 answer
232 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. ...
shearn89's user avatar
  • 3,433
1 vote
1 answer
552 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: "%{::...
Craig's user avatar
  • 11
0 votes
1 answer
124 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 --...
mc0e's user avatar
  • 5,911
1 vote
0 answers
127 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] ...
gfreestone's 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 ...
daks's user avatar
  • 673
-2 votes
1 answer
360 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('...
Dave Shaw's user avatar
1 vote
1 answer
1k 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}/%{...
DevOps's user avatar
  • 720
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] - ...
Arijit Ghosh's user avatar
0 votes
1 answer
186 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': ...
RikSaunderson's user avatar
10 votes
3 answers
11k 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....
Mojo's user avatar
  • 965
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 ...
Mojo's user avatar
  • 965
0 votes
1 answer
312 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 ...
Ulrar's user avatar
  • 387
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 ...
Itai Ganot's user avatar
  • 10.7k
0 votes
1 answer
858 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 ...
Sukiyakijango's user avatar
0 votes
0 answers
618 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 ...
sinned's 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 ...
Michelle's user avatar
  • 923
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 ...
Belmin Fernandez's 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 ...
Tom Arnautovic's 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 ...
Oyabi's 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: ...
Alex's user avatar
  • 9
0 votes
1 answer
3k 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 ...
Itai Ganot's user avatar
  • 10.7k
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 ...
Itai Ganot's user avatar
  • 10.7k