Daniel Kinon
2014-Aug-08 21:56 UTC
[Puppet Users] hiera-mysql working with hiera cli but not through puppet agent
Hello,
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?
Here are the pertinent details:
1. /etc/puppet/hiera.yaml:
2. ~~~~~
3. ---
4. :backends:
5. - yaml
6. - mysql
7.
8. :mysql:
9. :host: XXXXXXXX
10. :user: puppet
11. :pass: XXXXXXXXX
12. :database: hieradata
13. :query:
14. - 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}'
15.
16. :logger: console
17.
18. :yaml:
19. :datadir: '/etc/puppet/hieradata'
20.
21. :hierarchy:
22. - "certs/%{clientcert}"
23. - "hosts/%{fqdn}"
24. -
"deployment/%{::aws_vpc_name}/%{::aws_tag_merchant}-%{::aws_tag_cluster}"
25. - common
26. ~~~~
27.
28. output from hiera:
29. ~~~~
30. $ 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
31. 514
32. ~~~~
33.
34. output from puppet agent checkin:
35. ~~~~
36. # puppet agent -t
37. Info: Retrieving pluginfacts
38. Info: Retrieving plugin
39. Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
40. Info: Loading facts in /var/lib/puppet/lib/facter/aws-metadata.rb
41. Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
42. Info: Loading facts in /var/lib/puppet/lib/facter/staging_http_get.rb
43. Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
44. Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
45. Info: Loading facts in /var/lib/puppet/lib/facter/staging_windir.rb
46. Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
47. 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
48. Warning: Not using cache on failed catalog
49. Error: Could not retrieve catalog; skipping run
50. ~~~~
Thanks,
-Dan
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/ea214f6c-b81b-4eda-8646-ca68ac959d7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.