1

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 now). And I have a basic module set up that should check to make sure nginx is installed and a site config file is there. But when I run the environment using sudo r10k deploy environment -p -v, it seems to update everything, yet the module doesn't seem to be executing properly.

My module can be found here, and my control repo can be found here.

Is my module structured wrong? Am I missing something here? Is it because when I check the status of the puppet service using sudo service puppet status it spits out a few errors with my heira.yaml file?

● puppet.service - Puppet agent
   Loaded: loaded (/lib/systemd/system/puppet.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-02-22 23:07:06 UTC; 3min 0s ago
 Main PID: 19319 (puppet)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/puppet.service
           └─19319 /opt/puppetlabs/puppet/bin/ruby /opt/puppetlabs/puppet/bin/puppet agent --no-daemonize

Feb 22 23:07:06 puppeteer systemd[1]: Started Puppet agent.
Feb 22 23:07:07 puppeteer puppet-agent[19319]: Starting Puppet client version 5.4.0
Feb 22 23:07:09 puppeteer puppet-agent[19327]: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Lookup of key 'classes' failed:  The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, entry 'hierarchy' index 0 expects a Struct value, got String
Feb 22 23:07:09 puppeteer puppet-agent[19327]:   The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, entry 'hierarchy' index 1 expects a Struct value, got String
Feb 22 23:07:09 puppeteer puppet-agent[19327]:   The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, entry 'hierarchy' index 2 expects a Struct value, got String
Feb 22 23:07:09 puppeteer puppet-agent[19327]:   The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, unrecognized key 'backends'
Feb 22 23:07:09 puppeteer puppet-agent[19327]:   The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, unrecognized key 'yaml' (file: /etc/puppetlabs/code/environments/production/site.pp, line: 1, column: 1) on node puppeteer.c.personal-server-193919.internal
Feb 22 23:07:09 puppeteer puppet-agent[19327]: Applied catalog in 0.03 seconds

Contents of heira.yaml:

---
# Hiera 5 Global configuration file

version: 5

# defaults:
#   data_hash: yaml_data
# hierarchy:
#  - name: Common
#    data_hash: yaml_data
#hierarchy: [] (tried with and without this commented out)
:backends:
  - yaml
:hierarchy:
  - "%{clientcert}"
  - "%{environment}"
  - global
:yaml:
  :datadir: '/etc/puppetlabs/puppet/environmets/%{environment}/hieradata'
cclloyd
  • 583
  • 1
  • 13
  • 24
  • Maybe try putting double-quote around the "global" value in the hierarchy – DevOps Mar 01 '18 at 08:32
  • It looks like you have a Hiera 3 style hierarchy, but you've defined version 5 at the top of your hiera.yaml file. (The bits that are commented out are Hiera 5 style..) [Hiera: Convert a version 3 hiera.yaml to version 5](https://puppet.com/docs/puppet/5.0/hiera_migrate_v3_yaml.html) – Aaron Copley Mar 05 '18 at 22:32

0 Answers0