Morning All
I'm trying to use Hiera with Puppet 3.0 to streamline some of my module configuration...
However I'm having issues using the '
%{::clientcert}' variable as part of the hierarchy...
Currently, my
hiera.yaml file looks like:
---
:backends:
- yaml
- json
:yaml:
:datadir: /etc/puppet/hieradata
:json:
:datadir: /etc/puppet/hieradata
:hierarchy:
- nodes/%{::clientcert}
- common/%{::location}
- common/%{::environment}
- common/common
/etc/puppet/hieradata contains:
-bash-4.1$ ls -R /etc/puppet/hieradata/
/etc/puppet/hieradata/:
common nodes
/etc/puppet/hieradata/common:
common.yaml star-int.yaml test.yaml
/etc/puppet/hieradata/nodes:
puppet-test.card.co.uk.yaml
Currently I'm just testing with a notify in the
manifests/site.pp file:
The hiera values this node
should be pulling back is:
I am using an ENC with this puppet install, however that all appears to be working fine aswell...
Node ENC details are:
$ ./node.rb
puppet-test.card.co.uk---
environment: &id001 test
classes:
- act::products::cms
parameters:
root_pw: xybxa6JUkz63w
location: star-int
foreman_env: *id001
hostgroup: linux
puppetmaster: puppet
When I do a '
puppet agent -t' run on
puppet-test.card.co.uk, I get the following logged:
[gavinw@puppet-test ~]$ sudo puppet agent -t
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/oracle_sids.rb
Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/iptables.rb
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/lib/puppet/lib/facter/etckepper_puppet.rb
Info: Caching catalog for
puppet-test.card.co.ukInfo: Applying configuration version '1356087082'
Puppet-test.card.co.uk filername = actint filer
/Stage[main]//Node[
puppet-test.card.co.uk]/Notify[puppet-test_notify]/message: defined 'message' as '
Puppet-test.card.co.uk filername = actint filer'
Environment = test
/Stage[main]//Notify[environment]/message: defined 'message' as 'Environment = test'
Finished catalog run in 3.12 seconds
So puppet agent pulled back a value of '
actint filer', which is the value in my 'location' file.
$ hiera -c hiera.yaml filer_name location=star-int
actint filer
Any ideas why the %{::clientcert} isn't working?
Cheers
Gavin