Thanks for the reply John. Here's my hiera.yaml file:
---
:backends:
- yaml
:yaml:
:datadir: "/etc/puppet/%{::environment}/hieradata"
:hierarchy:
- "nodes/%{::clientcert}"
- "roles/%{::esg_role}"
- common
My puppet.conf file on the puppet master:
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
templatedir=$confdir/templates
server=puppet.eastsidegamestudio.com
privatekeydir = $ssldir/private_keys { group = service }
hostprivkey = $privatekeydir/$certname.pem { mode = 640 }
pluginsync=true
[master]
# These are needed when the puppetmaster is run by passenger
# and can safely be removed if webrick is used.
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
dns_alt_names = puppet.eastsidegamestudio.com
autosign = $confdir/autosign.conf { owner = service, group = service, mode
= 664 }
[production]
manifest = /etc/puppet/production/manifests/site.pp
modulepath = /etc/puppet/production/modules
fileserverconfig = /etc/puppet/production/fileserver.conf
templatedir = /etc/puppet/production/templates/
[staging]
manifest = /etc/puppet/staging/manifests/site.pp
modulepath = /etc/puppet/staging/modules
fileserverconfig = /etc/puppet/staging/fileserver.conf
templatedir = /etc/puppet/staging/templates/
[development]
manifest = /etc/puppet/development/manifests/site.pp
modulepath = /etc/puppet/development/modules
fileserverconfig = /etc/puppet/development/fileserver.conf
templatedir = /etc/puppet/development/templates/
And finally, the agent node's puppet.conf:
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
templatedir=$confdir/templates
server=puppet.eastsidegamestudio.com
[master]
# These are needed when the puppetmaster is run by passenger
# and can safely be removed if webrick is used.
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
[agent]
environment=development
I tried runnning the puppet agent and specifying the environment on the
command line but it didn't make a difference.I also moved the environment
directive in the agent conf file to the [main] section, but still no change.
Running hiera from the command line with the same settings as the agent
has, I get this:
$ hiera -d classes ::environment=development ::esg_role=couchbase
DEBUG: Thu Sep 12 17:45:31 +0000 2013: Hiera YAML backend starting
DEBUG: Thu Sep 12 17:45:31 +0000 2013: Looking up classes in YAML backend
DEBUG: Thu Sep 12 17:45:31 +0000 2013: Looking for data source
roles/couchbase
DEBUG: Thu Sep 12 17:45:31 +0000 2013: Found classes in roles/couchbase
[{"couchbase"=>nil}]
Testing for fact esg_role on the agent node:
$ facter esg_role
couchbase
For the record, my puppet version is 3.2.4, hiera is 1.2.1.
Hope this helps.
Regards,
Guy
On Thu, Sep 12, 2013 at 10:02 AM, jcbollinger <[email protected]>wrote:
>
>
> On Wednesday, September 11, 2013 5:50:18 PM UTC-5, Guy Knights wrote:
>>
>> I'm not sure at all what's going on here, but I've spent a lot of time
>> reading over the puppet hiera docs and setting everything up, but when I
>> run puppet agent it just seems to ignore the hiera setup completely.
>>
>> Both the puppet master and agent nodes have exactly the same versions of
>> puppet and hiera (installed via the official puppet APT repository). I've
>> laid out my hiera files like this: /etc/hiera/hiera.yaml,
>> /etc/hiera/data/%{::**environment}, have symlinked both
>> /etc/puppet/hiera.yaml and /etc/hiera.yaml to /etc/hiera/hiera.yaml, and
>> have tested the hiera setup using the command line utility. All seems good.
>>
>>
>
> Puppet uses hiera only during catalog compilation, so agent nodes do not
> normally require it. Correspondingly, only hiera data residing on the
> master contribute to catalogs compiled by the master -- is that your
> problem?
>
>
>
>> However, when I run puppet on the agent node it doesn't install any of
>> the classes I've outlined in my hierarchy. I tried running the puppet
>> master in debug mode to see if it was having problems locating the hiera
>> config but it seems to locate it ok, eg. "Debug:
>> /File[/etc/puppet/hiera.yaml]: Autorequiring File[/etc/puppet]". At least,
>> it doesn't appear to display any errors related to hiera.
>>
>> I'm really at a loss here. Any ideas?
>>
>>
>
> Are you anywhere instructing Puppet to include the classes listed in your
> hiera data in the catalog?
>
> You haven't really given us much to work with. Generally speaking, Puppet
> and hiera work. If they are not working for you, then the problem likely
> resides in the configuration, manifests, or data that you are feeding
> them. If you present a simple example that is failing for you, then we can
> probably help you sort it out.
>
>
> John
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/9kdUVvrsr18/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
Guy Knights
Lead Systems Administrator
<http://eastsidegamestudio.com>
www.eastsidegamestudio.com
[email protected]
<[email protected]>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.