I'm running opensource hiera 1.3.4 and puppet 3.6.2. I'm attempting to use hiera-yaml and hiera-mysql backends at the same time. When I run hiera on the command line I retrieve the values I expected from both yaml and mysql but when an agent checks in (daemon or manual), it isn't retrieving values from mysql. Any ideas on why command line works but agent checkin doesn't?
/etc/puppet/hiera.yaml:
~~~~~
---
:backends:
- yaml
- mysql
:mysql:
:host: XXXXXXXX
:user: puppet
:pass: XXXXXXXXX
:database: hieradata
:query:
- SELECT hieraValue FROM deployment WHERE hieraKey='%{key}' AND datacenter='%{::aws_vpc_name}' AND organization='%{::aws_tag_merchant}' AND environment='%{::aws_tag_cluster}' AND puppetEnv='%{env}'
:logger: console
:yaml:
:datadir: '/etc/puppet/hieradata'
:hierarchy:
- "certs/%{clientcert}"
- "hosts/%{fqdn}"
- "deployment/%{::aws_vpc_name}/%{::aws_tag_merchant}-%{::aws_tag_cluster}"
- common
~~~~
output from hiera:
~~~~
$ hiera -c /etc/puppet/hiera.yaml testmodule::deploy::latest_build nothing ::aws_vpc_name=mc2 ::aws_tag_merchant=test ::aws_tag_cluster=testcluster env=production
514
~~~~
output from puppet agent checkin:
~~~~
# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/aws-metadata.rb
Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/staging_http_get.rb
Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/staging_windir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find data item testmodule::deploy::latest_build in any Hiera data file and no default supplied at /etc/puppet/modules/testmodule/manifests/init.pp:79 on node testnode1.local
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
~~~~