[Puppet Users] hiera error in agent run after reboot

2017-02-13 Thread Michael Zoet

Hello Puppet Users,

I have a strange problem after I restarted my Puppet master (and  
several other nodes). When I do a puppet agent run now I get the  
following output:


===
puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on  
SERVER: Server Error: Evaluation Error: Error while evaluating a  
Resource Statement, Lookup of key 'lookup_options' failed: The Lookup  
Configuration at '/etc/puppetlabs/code/hiera.yaml' has wrong type,  
unrecognized key 'http' at  
/etc/puppetlabs/code/environments/production/roles/role_base/manifests/init.pp:5:5 on node  
host-1.node.ekimp.local

Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

The contents of /etc/puppetlabs/code/hiera.yaml
===
---
:backends:
  - yaml
  - etcd

:logger: console

:hierarchy:
  - nodes/%{trusted.certname}
  - projects/%{node_project}
  - roles/%{node_role}/%{node_instance}
  - roles/%{node_role}
  - location/%{node_location}/%{node_location_no}
  - location/%{node_location}
  - server_type/%{node_server_type}
  - os/%{operatingsystem}/%{lsbdistcodename}
  - users
  - common
  - passwords

:yaml:
  :datadir: '/etc/puppetlabs/code/environments/%{environment}/data'

:http:
  :host: 192.168.122.1
  :port: 4001
  :paths:
- /data/nodes/%{trusted.certname}
- /data
===

The :http: config is for connecting to etcd via this Puppet module  
https://forge.puppet.com/garethr/hiera_etcd.


For me it seems that this module is not loaded anymore. What bothers  
me is that there were no configuration changes, only the reboot.  
Before the reboot everything worked fine. After that the logs are full  
with the error message from above.
I am completely at a loss here what might be wrong. Has someone any  
ideas? Or hints? Or links to documentation? Or recommendations how to  
use etcd (https://github.com/coreos/etcd) with hiera? (I did not set  
this up I am only maintaining it.)


Technical details:
- all servers run Debian Jessie
- packages are from the Puppetlabs Debian repository http://apt.puppetlabs.com
- Puppetserver version 2.7.2-1puppetlabs1
- Puppet agent version 1.9.1-1jessie on all nodes

Content of  
/etc/puppetlabs/code/environments/production/roles/role_base/manifests/init.pp  
(Nothing fancy, it is the base class that every node gets applied.)

===
# base class for everyone
class role_base {
  class pre {
# ensure_resource('class', 'profile_base::apt', {})
class { 'profile_base': }
  }
  class { 'role_base::pre': stage => 'pre_setup' }

  class { 'profile_base::apt': }
  class { 'profile_base::locales': }
  class { 'profile_base::network': }
  class { 'profile_etcd': }
  class { 'profile_base::user': }
  class { 'profile_base::sudo': }
  class { 'profile_base::puppet': }
  class { 'profile_base::backup': }
  class { 'profile_base::env': }
  class { 'profile_base::ssh': }
  class { 'profile_base::host': }
  class { 'profile_icinga': }

  if $virtual == 'physical' {
class { 'profile_base::ntp': }
  }
}
===

THX in advance,
Michael

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20170213164712.Horde.NapSrKyfMK4SQahhu22ItQ3%40server06.zoet.de.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Hiera setup

2016-02-29 Thread Michael Zoet

Hello to all,

I am in the process of changing a Puppet setup to use environments and 
hiera. The environment setup works fine but I have a problem setting up 
hiera.


I have  a basic Hiera setup in one environment but when I try to use it 
I get the following:


puppet master --compile example.com  --environment=testenv --debug

Info: Caching node for example.com
Debug: hiera(): Hiera YAML backend starting
Debug: hiera(): Looking up hiera_classes in YAML backend
Error: Undefined variable "::trusted.certname"; Undefined variable 
"trusted.certname" at 
/etc/puppet/environments/testenv/manifests/node.pp:1 on node example.com
Error: Undefined variable "::trusted.certname"; Undefined variable 
"trusted.certname" at 
/etc/puppet/environments/testenv/manifests/node.pp:1 on node  example.com
Error: Failed to compile catalog for node example.com: Undefined 
variable "::trusted.certname"; Undefined variable "trusted.certname" at 
/etc/puppet/environments/testenv/manifests/node.pp:1 on node example.com


I use as the hiera.yaml file the setup from 
https://docs.puppetlabs.com/hiera/3.0/complete_example.html, meaning my 
hiera.yaml file looks like this||


|--- :backends: - yaml :yaml: :datadir: 
"/etc/puppetlabs/code/environments/%{environment}/hieradata" :hierarchy: 
- "nodes/%{::trusted.certname}" - common |


|In node.pp I have just a
||
hiera_include('classes')||

in this environment.

How do I get Puppet to populate ||%{::trusted.certname}| with the 
certname for the host? Or better what do I need to configure, to get 
this setup working?


I am using Puppet 3.6.s on a SLES 12.1 distro.

Thx in advance for any hint and answer,
Michael

 


--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/56D49796.4020302%40zoet.de.
For more options, visit https://groups.google.com/d/optout.