Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all 257 articles
Browse latest View live

Hiera lookup function behaves differently in interpolation tokens

$
0
0
Dear Community, I'm using Puppet 4.2.1 and I've recently discovered that the `hiera()` lookup function behaves differently for non-existent keys when used in a YAML interpolation token vs. when called directly. In the latter case, the following statements (correctly) raise an error: CLI: $ puppet apply -e "notice(hiera('non-existent'))" Error: Evaluation Error: Error while evaluating a Function Call, Could not find data item non-existent in any Hiera data file and no default supplied... site.pp: class configuration { hiera('non-existent') } => Same Error message However, if I lookup a non-existent key in a YAML interpolation token, **no error** is being reported and the function seems to return the empty string: YAML --- limbo: "%{hiera('non-existent)}" I spent several hours debugging a puppet module, which failed due to a parameter set to the empty string. This unexpected behaviour was caused by the hiera() lookup function silently ignoring a key that wasn't initialised. Is this really intended behaviour? Or am I using the lookup function incorrectly? Have I missed something in the documentation? Thank you for your help clarifying this issue

prevent interpolation with file_line and hiera

$
0
0
I am using file_line to add a line to my sudoers file. The line I need to add includes a "%{user}" which I need to be quoted literally. If I use file_line from my site.pp it works great...the line is passed with single quotes and interpolation does not occur. However, when I use file_line within a Hiera construct the "%{user}" gets interpolated and the resulting string is missing this required portion. I've tried various escapes all without success. I'm out of ideas at this point. Hopefully the community here can provide an answer.

Transfer code from site.pp to common.yaml

$
0
0
Hi, i will rewrite my question. according to what i understood from documentation, I should use yaml files with hiera instead of the regular manifest site.pp. I want instead of writing in the site.pp file to write in the common.yaml file, however i have some difficulty with the syntax of yaml. I want to write the following code in the common.yaml file: file { '/tmp/name': ensure => present, } which mean i want to create file in /tmp/ with the name "name" and ensure he is present. and writing all this in yaml file so my server will check if that file exist.

Transform Puppet F5 Big IP Resource Manifest to Hieradata

$
0
0
Hi all, Would like to ask if any build-in method(s) transforming from F5 Big IP Resource Manifest to hieradata (YAML)? We starts including F5 Big IP to be under Puppet management and governance. We can query all existing F5 Big IP node/pool/irule/virtualserver/monitor/etc with below command: FACTER_url=https://username:Password@big-ip-hostname/ puppet resource f5_node In order to prepare YAML files effectively and avoid preparing the huge number of lines in YAML (start from scratch), we are looking for a way to quickly transform the query results to YAML files. Would like to know if you guys having similar experience, or actually Puppet Enterprise already got the function to do so. Please kindly share. Thanks a lot! Regards, Jessie Yeung

How to access map variable using hiera?

$
0
0
# test.yaml x-certificate: id:'xxxxx' name:'x' How to access id value of x-certificate using hiera? Is it possible?

Automatic parameter lookup: best practice?

$
0
0
When utilizing Puppet's automatic parameter lookup in Hiera, what is the better pattern: keep all parameters in init.pp and refer to them in subclasses (similarly to the old params.pp scheme), or skip the parameters in init.pp and use subclasses to set them? Pattern 1: all parameters in init.pp, e.g. class myapplication ( $ssl_enable, $ssl_cert, $ssl_key, $ssh_access_enable, $ssh_access_key ... ) { contain myapplication::ssh contain myapplication::ssl } class myapplication::ssl ( $enable = $::myapplication::ssl_enable, ... ) { ... } Pattern 2: parameters in subclasses, e.g. class myapplication { contain myapplication::ssh contain myapplication::ssl } class myapplication::ssl ( $enable, $cert, $key ) { ... } With APL and Hiera, the latter seems cleaner and more sensible -- it's easier to figure out where to set the parameter, IMO -- but the obvious downside is that parameters aren't all in one place, so it's theoretically harder to find them. I haven't been able to find any opinions on the matter. (I'm not using the params.pp model because the modules I'm making are for one OS only, and the only real application of params.pp that I can see, now that we have APL, is dealing with OS variants.)

configuring passenger from hiera with puppetlabs-apache module

$
0
0
I'm looking to setup a Passenger app using the puppetlabs-module, configuring via hiera. If I use the following vhost definition it works fine: web::vhosts: node.com: docroot: /var/www/app serveraliases: "%{fqdn}" passenger_app_env: production passenger_pre_start: "http://%{fqdn}/contact" passenger_min_instances: 3 directories: - path: /var/www/app passenger_enabled: "on" but if I try to define the pool_idle_time for passenger with the following config web::vhosts: node.com: docroot: /var/www/app serveraliases: "%{fqdn}" passenger_app_env: production passenger_pre_start: "http://%{fqdn}/contact" passenger_min_instances: 3 passenger_pool_idle_time: 0 directories: - path: /var/www/app passenger_enabled: "on" I get an error > Error: Could not retrieve catalog from> remote server: Error 400 on SERVER:> Invalid parameter> passenger_pool_idle_time on node> abc.co.uk but from looking at the templates/mod/passenger.conf.erb it looks as if that is an option that can be configured.

Hiera returning wrong environment from YAML source

$
0
0
Hey Comm, Would be grateful if anyone could help me with this. Aim: I'm trying to assign an environment other than default production using an ENC script I've written in bash. The script calls hiera as follows where it fails: hiera environment -y /etc/puppetlabs/code/nodes/test.hs1.nl.yaml --config /etc/puppetlabs/code/hiera-enc.yaml -d DEBUG: 2016-01-04 23:28:02 +0100: Hiera YAML backend starting DEBUG: 2016-01-04 23:28:02 +0100: Looking up environment in YAML backend DEBUG: 2016-01-04 23:28:02 +0100: Looking for data source default DEBUG: 2016-01-04 23:28:02 +0100: Found environment in default production Content of `/etc/puppetlabs/code/nodes/test.hs1.nl.yaml`: --- environment: 'hs1-ext' Content of `/etc/puppetlabs/code/hiera-enc.yaml`: --- :backends: - yaml :hierarchy: - "%{::fqdn}" - "default" :yaml: :datadir: /etc/puppetlabs/code/nodes Am I overseeing anything? Thanks in advance! Richard

Unable to get data from hiera. It must be simple....

$
0
0
My end goal is to iterate through a puppet hash and configure multiple VRFs. I was able to do that when the hash is locally defined using below code: $tenant_vrf_info = { 1=>{vrf=>"evpn-tenant-1", l3_vni=>"5010", rd=>"2000:5010", import=>"2000:5010"}, 2=>{vrf=>"evpn-tenant-2", l3_vni=>"5020", rd=>"2000:5020", import=>"2000:5020", } $tenant_vrf_info.each |$tenant,$value| { $tenant_id = "$tenant" $tenant_vrf_context = "${value[vrf]}" $tenant_l3_vni = "${value[l3_vni]}" cisco_command_config { $tenant_id: command => " vrf context $tenant_vrf_context vni ${value[l3_vni]} address-family ipv4 unicast " } } I decided to get this data from Hiera. This is when the nightmare began... I cannot get the data out of the hash. I just want the data out hiera so I can iterate through it using .each. Below is my setup. When I run below code I get this error: **Evaluation Error: Empty string title at 0. Title strings must have a length greater than zero.** **YAML File:** --- vrfs: vrf-evpn-tenant-2: l3_vni: 20101 rd: '2000:20101' vrf-evpn-tenant-3: l3_vni: 20102 rd: '2000:20102' **HIERA:** hiera -d vrfs {"vrf-evpn-tenant-2"=>{"l3_vni"=>20101, "rd"=>"2000:20101"}, "vrf-evpn-tenant-3"=>{"l3_vni"=>20101, "rd"=>"2000:20101"}} **Puppet Manifest:** class rbc_vrf { include install include stdlib $tenant_vrf_info_hiera = hiera('vrfs') notify{"${tenant_vrf_info_hiera['l3_vni']}":} }

how can i access fact hashes in hiera hierarchies

$
0
0
using puppet open source 3.8.4, hiera 1.3.4 and I am trying to figure out how to access a custom structured data fact to build out my hiera yaml hierarchy. when i run puppet in debug mode it doesn't find the component hierarchy, it just finds `environment/common` and `common`. As soon as i switch the fact from a hash to basic individual string variables and update the hierarchy to be `%{::component}` it finds the path. At what version did hiera support hashed facts in its config file, or am i missing something. **note** I have tried various different syntaxes of `::sapenvs:component` i.e; `::sapenvs[component]`, `::sapenvs.component`. **/etc/facter/facts.d/kickstart.yaml** --- sapenvs: component: 'ECC' **hiera.yaml** --- :backends: - yaml :yaml: :datadir: /opt/puppet/hieradata :hierarchy: - "%{::environment}/%{::sapenvs:component}/common" - "%{::environment}/common" - "common"

Using Puppet Apply with Hiera for building Docker images

$
0
0
I'm trying to build a docker image with Puppet Apply and Hiera. The puppet module can be found here [1], hiera data files can be found here [2] and Dockerfile is as follows: FROM ubuntu:15.10 MAINTAINER imesh@abc.org ENV DEBIAN_FRONTEND noninteractive RUN apt-get -y update RUN apt-get -y install puppet COPY puppet/ /etc/puppet/ ENV FACTER_product_name: wso2esb ENV FACTER_product_version: 4.9.0 ENV FACTER_product_profile: default ENV FACTER_environment: dev ENV FACTER_vm_type: docker RUN puppet apply --modulepath=/etc/puppet/manifests/site.pp --hiera_config /etc/puppet/hieradata/hiera.yaml --verbose --detailed-exitcodes || [ $? -eq 2 ] # Servlet and pass-through transport ports EXPOSE 9763 9443 8280 8243 ENTRYPOINT /usr/local/bin/init.sh **Question** Once I run the Docker build command I get the following error: Step 15 : RUN puppet apply --modulepath=/etc/puppet/manifests/site.pp --hiera_config /etc/puppet/hieradata/hiera.yaml --verbose --detailed-exitcodes || [ $? -eq 2 ] ---> Running in 771731292a99 Error: Could not find data item classes in any Hiera data file and no default supplied at /etc/puppet/manifests/site.pp:20 on node ca5fd9ca11dc Error: Could not find data item classes in any Hiera data file and no default supplied at /etc/puppet/manifests/site.pp:20 on node ca5fd9ca11dc The command '/bin/sh -c puppet apply --modulepath=/etc/puppet/manifests/site.pp --hiera_config /etc/puppet/hieradata/hiera.yaml --verbose --detailed-exitcodes || [ $? -eq 2 ]' returned a non-zero code: 1 Appreciate any thoughts on this! [1] https://github.com/wso2/puppet-modules/tree/master/wso2esb [2] https://github.com/wso2/puppet-modules/blob/master/hiera/hieradata/dev/wso2/wso2esb/4.9.0/default.yaml

Is Puppet Evaluating Variables in my YAML data?

$
0
0
I have this in a yaml file in my hiera data: wsgi_keystone_conf_contents: | Listen 5000 Listen 35357 WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP} WSGIProcessGroup keystone-public WSGIScriptAlias / /var/www/cgi-bin/keystone/main WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On LogLevel info ErrorLogFormat "%{cu}t %M" ErrorLog /var/log/httpd/keystone-error.log CustomLog /var/log/httpd/keystone-access.log combined WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP} WSGIProcessGroup keystone-admin WSGIScriptAlias / /var/www/cgi-bin/keystone/admin WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On LogLevel info ErrorLogFormat "%{cu}t %M" ErrorLog /var/log/httpd/keystone-error.log CustomLog /var/log/httpd/keystone-access.log combined And I try to create a my `wsgi-keystone.conf` file in my puppet manifest like so : file { '/etc/httpd/conf.d/wsgi-keystone.conf': ensure => present, content => $wsgi_keystone_conf_contents, } But this results in a file that looks like this ... Listen 5000 Listen 35357 WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name= WSGIProcessGroup keystone-public WSGIScriptAlias / /var/www/cgi-bin/keystone/main WSGIApplicationGroup WSGIPassAuthorization On LogLevel info ErrorLogFormat "t %M" ErrorLog /var/log/httpd/keystone-error.log CustomLog /var/log/httpd/keystone-access.log combined WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name= WSGIProcessGroup keystone-admin WSGIScriptAlias / /var/www/cgi-bin/keystone/admin WSGIApplicationGroup WSGIPassAuthorization On LogLevel info ErrorLogFormat "t %M" ErrorLog /var/log/httpd/keystone-error.log CustomLog /var/log/httpd/keystone-access.log combined The above file has syntax error and httpd will not restart. How am I supposed to put data in my YAML file? Do I need to escape the `%`'s?

How to distribute hiera files with puppet modules via puppet forge?

$
0
0
Hi all, I'm using puppet 3.4.3, and my modules are tightly coupled to hiera. I would like to know the options that I have for distributing the hiera files (hiera.yaml and a few basic yaml backend files which users can customize to suit their needs) with puppet modules. The requirement is, when the user does puppet module install , the hiera files should be copied to default data directory (/etc/puppet/hieradata). If there is a better way to do this, kindly let me know. Thanks.

Duplicate declaration error when using Ini_setting

$
0
0
I'm getting this error when using ini_setting and hiera "Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, Duplicate declaration: Ini_setting[[database] connection] is already declared; cannot redeclare at /etc/puppetlabs/code/environments/production/manifests/site.pp:50:3 on node lib-glance.liberty.local" I know why i am getting the error, here is my puppet code node 'lib-glance' { include glance::api include glance::registry } class glance::api ($settings,){ # validate_hash($apisettings) $defaults = { 'path' => '/etc/glance/glance-api.conf' } create_ini_settings($settings, $defaults) } class glance::registry($settings,){ # validate_hash($registrysettings) $regdefaults = { 'path' => '/etc/glance/glance-registry.conf' } create_ini_settings($settings, $regdefaults) } And here is the associated heira glance::api::settings: DEFAULT: notification_driver: "noop" verbose: "true" database: connection: "mysql://glance:%{hiera('databasePasswords::glance')}@%{hiera('mysql::virtualIP')}/glance" glance::registry::settings: database: connection: "mysql://glance:%{hiera('databasePasswords::glance')}@%{hiera('mysql::virtualIP')}/glance Clearly when the second `create_ini_settings` runs it is detects the duplicate variable definition from the database \ Connection setting and throws an error. But my intention is to write these values into separate config files(This works if i remove the duplication). So how do I fix this?

How do I submit a fix/request a fix to hiera in CentOS 7.2?

$
0
0
When I attempt to use Hiera on CentOS 7.2 from a clean install it doesn't work. The default hiera.yml file is in /etc/puppet. Only by making a soft link and creating a new directory called /etc/puppetlabs/code/hiera.yml and link to it does hiera then work from the default install. I have a couple ways to fix the CentOS7.2 package or Hiera at its root, what is the proper way to do this?

Having trouble converting YAML into LogFormat statement

$
0
0
I'm trying to work out the correct YAML syntax that would produce the following statement in /etc/httpd/conf/httpd.conf via Hiera): LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" extended After several attempts, I wind up with one of three results: LogFormat "%v %h %l %u %t "%r" %s %b "i" "i"" extended -- or -- LogFormat "%v %h %l %u %t "%r" %s %b "\i" "\i"" extended -- or -- LogFormat "%v %h %l %u %t "%r" %s %b "%\{Referer\}i" "%\{User-Agent\}i"" extended (Here is the YAML that produced the above:) apache::log_formats: extended: "%v %h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"" -- or -- apache::log_formats: extended: "%v %h %l %u %t \"%r\" %s %b \"\%{Referer}i\" \"\%{User-Agent}i\"" -- or -- apache::log_formats: extended: "%v %h %l %u %t \"%r\" %s %b \"%\{Referer\}i\" \"%\{User-Agent\}i\"" I've tried several other combinations in attempts to comment out either the "%" or the "{" from being interpreted somewhere to no avail. Help!! My environment: - CentOS 6.6 - Puppet 3.7.0 - puppetlabs-apache 1.7.1 Thank you for any assistance! Allen

How to filter hash in puppet manifest?

$
0
0
Hi all, could you please help me. I'm getting dict from hiera in puppet manifest and then trying to filter it and pass in a python script as args.But have an issues. My hiera: myclass::server_conf: 'first_serv': 'serv_name': 'testname' 'serv_hostname': 'testhost' 'test_url': 'test@url.com' 'second_serv': 'serv_name': 'testname2' 'serv_hostname': 'testhost2' 'test_url': 'test@url.com2' My puppet manifest(i'm getting hash from values in hiera): $server_conf = hiera_hash('myclass::server_conf', {}) As result of this i had $server_conf which contain: {"first_serv"=>{"serv_name"=>"testname", "serv_hostname"=>"testhost", "test_url"=>"test@url.com"}, "second_serv"=>{"serv_name"=>"serv2", "serv_name"=>"testname2", "serv_hostname"=>"testhost2", "test_url"=>"test@url.com2"}} Then i want to select from this list only values: 'testname' 'testhost' 'test@url.com' 'testname2' 'testhost2' 'test@url.com2' I'm trying to do it using map function: $transforrmed_data = map(server_conf) |$key,$value| { $value } And getting error: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not match |$key,$value| at /manifests/server.pp:26 on node test.node How can i solve this problem? Also I need to transfer to one more variable `'testname2' 'testhost2' 'test@url.com2'` and pass it to exec command resource. Or somehow run exec command twice with values from `first_serv` and `second_serv`. Thanks for any help!

"" is not a Hash. It looks to be a String

$
0
0
I have **init.pp** as below: class mymodule { include mymodule::users include mymodule::install include mymodule::config include mymodule::service Class[mymodule::users] -> Class[mymodule::install] -> Class[mymodule::config] -> Class[mymodule::service] } I have **install.pp** as below: class mymodule::install ( $artifacts = undef, ) inherits mymodule::params { validate_hash($artifacts) create_resources('different_module::artifact', $artifacts) } And I am creating specs for these classes as below: **init_spec.pp** require 'spec_helper' require 'hiera' describe 'mymodule', :type => :class do let(:pre_condition) { ' include mymodule::install include mymodule::users include mymodule::service include mymodule::config ' } it { should contain_class('mymodule') } end **install_spec.pp** require 'spec_helper' require 'hiera' describe 'mymodule::install', :type => :class do let(:pre_condition) {'include different_module' } let(:hiera_config) { 'spec/fixtures/hiera/hiera.yaml' } hiera = Hiera.new(:config => 'spec/fixtures/hiera/hiera.yaml') artifacts = hiera.lookup('mymodule::install::artifacts', nil, nil) let(:params) { { :artifacts => artifacts } } it { should contain_class('mymodule::install') } it { should contain_different_module__artifact('mymodule') } } **spec/fixtures/hiera/hiera.yaml** --- :backends: - yaml :yaml: :datadir: spec/fixtures/hieradata :hierarchy: - common **spec/fixtures/hieradata/common.yaml** mymodule::install::artifacts: mymodule: groupid: 'au.com.org.app' artifactid: 'mymodule' version: 'r1.0' type: 'tgz' destination: '/tmp/mymodule_r1.0.tar.gz' timeout: '0' When I run rspec I am getting the below error: "" is not a Hash. It looks to be a String at /tmp/mymodule/spec/fixtures/modules/mymodule/manifests/install.pp:6 EDIT: When I add Alex's fail statement before `validate_hash` all the specs have been failed. Interestingly, I can see the below, only for `should contain_class`, it is empty: 1) mymodule should contain Class[mymodule] Failure/Error: it { should contain_class('mymodule') } Puppet::Error: I got for artifacts at /tmp/mymodule/spec/fixtures/modules/mymodule/manifests/install.pp:6 on node debian-vm.localdomain And for other specs I can see the value of artifacts as below: 3) mymodule::install should contain Class[mymodule::install] Failure/Error: it { should contain_class('mymodule::install') } Puppet::Error: I got {"mymodule"=>{"groupid"=>"au.com.env.app", "artifactid"=>"mymodule", "version"=>"r4", "type"=>"tgz", "destination"=>"/tmp/mymodule_r49.tar.gz", "timeout"=>"0"}} for artifacts at /tmp/mymodule_r4/spec/fixtures/modules/mymodule_r4/manifests/install.pp:6 on node debian-vm.localdomain

Masterless puppet with hiera dynamic lookup?

$
0
0
Hello,
Here's what I'm trying to achieve:
- masterless puppet for dev,stg,prd environments - on each node have only one version of modules (only for respective environment) - still use hiera for hierarchy and parameter lookups. My puppet.conf looks like this: [main] logdir = /var/log/puppet rundir = /var/run/puppet ssldir = $vardir/ssl environmentpath = $confdir/environments environment = development [agent] classfile = $vardir/classes.txt localconfig = $vardir/localconfig My hiera.yaml: --- :backends: - yaml :yaml: :datadir: /etc/puppet/environments/%{environment}/hieradata :hierarchy: - "%{environment}" - "node/%{::fqdn}" - common :logger: console Environments tree: /etc/puppet/environments/ ├── development │ ├── development.yaml │ ├── hieradata │ │ ├── common.yaml │ │ ├── development.yaml │ │ └── node │ ├── manifests │ │ └── site.pp │ └── modules │ ├── apache ├── production │ ├── hieradata │ └── manifests │ └── site.pp └── staging ├── hieradata │ └── staging.yaml └── manifests └── site.pp I /etc/puppet/environments/development/hieradata/development.yaml I have parameter: apache::private_ip: '10.111.111.111' and command: hiera apache::private_ip environment=development works fine but when I issue: puppet apply /etc/puppet/environments/development/manifests/site.pp --verbose I get: Error: Could not run: Hiera type mismatch: expected Array and got NilClass With debug mode on is still not much helpful: Debug: Runtime environment: ruby_version=1.8.7, puppet_version=3.8.4, run_mode=user Debug: Evicting cache entry for environment 'development' Debug: Caching environment 'development' (ttl = 0 sec) Debug: Evicting cache entry for environment 'development' Debug: Caching environment 'development' (ttl = 0 sec) Debug: Loading external facts from /var/lib/puppet/facts.d Info: Loading facts Debug: Loading facts from /etc/puppet/environments/development/modules/stdlib/lib/facter/pe_version.rb Debug: Loading facts from /etc/puppet/environments/development/modules/stdlib/lib/facter/facter_dot_d.rb Debug: Loading facts from /etc/puppet/environments/development/modules/stdlib/lib/facter/puppet_vardir.rb Debug: Loading facts from /etc/puppet/environments/development/modules/stdlib/lib/facter/root_home.rb Info: Loading facts Debug: Loading facts from /etc/puppet/environments/development/modules/puppi/lib/facter/puppi_projects.rb Debug: Loading facts from /etc/puppet/environments/development/modules/puppi/lib/facter/last_run.rb Debug: Loading facts from /etc/puppet/environments/development/modules/puppi/lib/facter/windows_common_appdata.rb Info: Loading facts Debug: Loading facts from /etc/puppet/modules/stdlib/lib/facter/pe_version.rb Debug: Loading facts from /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb Debug: Loading facts from /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb Debug: Loading facts from /etc/puppet/modules/stdlib/lib/facter/root_home.rb Info: Loading facts Debug: Loading facts from /etc/puppet/modules/puppi/lib/facter/puppi_projects.rb Debug: Loading facts from /etc/puppet/modules/puppi/lib/facter/last_run.rb Debug: Loading facts from /etc/puppet/modules/puppi/lib/facter/windows_common_appdata.rb Info: Loading facts Debug: Loading facts from /var/lib/puppet/lib/facter/pe_version.rb Debug: Loading facts from /var/lib/puppet/lib/facter/facter_dot_d.rb Debug: Loading facts from /var/lib/puppet/lib/facter/puppet_vardir.rb Debug: Loading facts from /var/lib/puppet/lib/facter/root_home.rb Debug: Evicting cache entry for environment 'development' Debug: Caching environment 'development' (ttl = 0 sec) Debug: hiera(): Hiera YAML backend starting Debug: hiera(): Looking up classes in YAML backend Debug: hiera(): Looking for data source development Debug: hiera(): Found classes in development Error: Could not run: Hiera type mismatch: expected Array and got NilClass Puppet version 3.8.4 and hiera 1.3.4 Any suggestions on what could be wrong here, greatly appreciated. Thank you

%{calling_class} doesn't seem to work in hierarchy

$
0
0
Trying to do this in my hiera.yaml: ---
:backends:
- yaml
:hierarchy:
- "nodes/%{::fqdn}"
- "roles/%{calling_class}"
- common The "nodes" entry works if I name a file to match the fqdn (in my test, I am pulling NTP server settings from Hiera). I can't get the data at the roles level to work. Filenames are matching the class::subclass name (in this case, roles::myrole.yaml). The colon is a valid character in Unix for filenames, but it is a special character and needs to be escaped with a \ when referenced on the command line. Not sure if that's an issue or not.
Viewing all 257 articles
Browse latest View live