hiera-mysql working with hiera cli but not through puppet agent

28 views
Skip to first unread message

Daniel Kinon

unread,
Aug 8, 2014, 5:56:28 PM8/8/14
to puppet...@googlegroups.com

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


Reply all
Reply to author
Forward
0 new messages