hiera-http icon indicating copy to clipboard operation
hiera-http copied to clipboard

heira5 lookkup not working with Jenkins data store

Open rajeevsh990 opened this issue 6 years ago • 0 comments

I am using PE 2017.3 with Hiera 5 backend along with Jenkins 2.11. I have already integrated Jenkins to Puppet with puppet pipeline plugin and it's working fine.

Issue: not able to lookup key from puppet lookup or puppet manifest. I have tried interpolating all tags but nothing worked.

[root@puppetmaster puppet]# puppet lookup test::test_hiera::myname --environment production --explain Warning: Module 'puppet_enterprise': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/pe.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/pe.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/pe.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/pe.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/pe.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/pe.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/pe.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/common.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/common.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/common.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/common.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/common.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/common.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/common.conf', must use keys qualified with the name of the module Warning: Module 'pe_repo': Value returned from data_hash function 'hocon_data', when using location '/etc/puppetlabs/enterprise/conf.d/common.conf', must use keys qualified with the name of the module Searching for "lookup_options" Module data provider for module "test" not found Searching for "test::test_hiera::myname" Global Data Provider (hiera configuration version 5) Using configuration "/etc/puppetlabs/puppet/hiera.yaml" Hierarchy entry "Jenkins data source" URI "http://myjenkins:8181/hiera/lookup?scope=jenkins&key=__KEY__" Original uri: "http://myjenkins:8181/hiera/lookup?scope=jenkins&key=__KEY__" No such key: "test::test_hiera::myname" Querying http://myjenkins:8181/hiera/lookup?scope=jenkins&key=test::test_hiera::myname URI "http://myjenkins:8181/hiera/lookup?scope=puppetmaster&key=__KEY__" Original uri: "http://myjenkins:8181/hiera/lookup?scope=%{trusted.certname}&key=__KEY__" No such key: "test::test_hiera::myname" Querying http://myjenkins:8181/hiera/lookup?scope=puppetmaster&key=test::test_hiera::myname URI "http://myjenkins:8181/hiera/lookup?scope=puppetmaster&key=__MODULE__" Original uri: "http://myjenkins:8181/hiera/lookup?scope=%{trusted.certname}&key=__MODULE__" No such key: "test::test_hiera::myname" Querying http://myjenkins:8181/hiera/lookup?scope=puppetmaster&key=test URI "http://myjenkins:8181/hiera/lookup?scope=puppetmaster&key=__CLASS__" Original uri: "http://myjenkins:8181/hiera/lookup?scope=%{trusted.certname}&key=__CLASS__" No such key: "test::test_hiera::myname" Querying http://myjenkins:8181/hiera/lookup?scope=puppetmaster&key=test::test_hiera URI "http://myjenkins:8181/hiera/lookup?scope=puppetmaster&key=__PARAMETER__" Original uri: "http://myjenkins:8181/hiera/lookup?scope=%{trusted.certname}&key=__PARAMETER__" No such key: "test::test_hiera::myname" Querying http://myjenkins:8181/hiera/lookup?scope=puppetmaster&key=myname URI "http://myjenkins:8181/hiera/lookup?scope=production&key=__KEY__" Original uri: "http://myjenkins:8181/hiera/lookup?scope=%{environment}&key=__KEY__" No such key: "test::test_hiera::myname" Querying http://myjenkins:8181/hiera/lookup?scope=production&key=test::test_hiera::myname Environment Data Provider (hiera configuration version 5) Using configuration "/etc/puppetlabs/code/environments/production/hiera.yaml" Hierarchy entry "Per-node data (yaml version)" Path "/etc/puppetlabs/code/environments/production/data/nodes/puppetmaster.yaml" Original path: "nodes/%{::trusted.certname}.yaml" Found key: "test::test_hiera::myname" value: "sharma"

The above code is able to put http query to Jenkins (logs showing 404 error) but couldn't fetch the value. it seems anything wrong at puppet server itself. please find hiera.yaml below:

`version: 5

defaults: datadir: hieradata data_hash: yaml_data

hierarchy:

  • name: 'Jenkins data source' lookup_key: hiera_http uris:
    • "http://myjenkins:8181/hiera/lookup?scope=%{trusted.certname}&key=KEY"
    • "http://myjenkins:8181/hiera/lookup?scope=%{trusted.certname}&key=MODULE"
    • "http://myjenkins:8181/hiera/lookup?scope=%{trusted.certname}&key=CLASS"
    • "http://myjenkins:8181/hiera/lookup?scope=%{trusted.certname}&key=PARAMETER"
    • "http://myjenkins:8181/hiera/lookup?scope=%{environment}&key=KEY" options: output: json failure: graceful use_auth: false auth_user: admin auth_pass: xxxxx`

Please let me know if I have a mis-configuration here. I have struggled a lot to solve this but couldn't find much information on web.

rajeevsh990 avatar Apr 19 '18 10:04 rajeevsh990