通过redis hiera-backend的数据查找()在puppet 5上失败

我正在调查从傀儡开源3.8.x到傀儡5的一个可能的行动,我正在尝试新的应用程序和服务。 我解决了几乎所有的问题,直到我遇到了hiera和redis后端的问题。

https://github.com/reliantsolutions/hiera-redis

注意 :“我知道老是从2015年”,但相信我,基本上所有的hiera后端(mongo,mysql等)都是旧的或者不工作。

所以,激活redis后端并进行以下设置:

defaults: datadir: hieradata data_hash: yaml_data hierarchy: - name: redis hiera3_backend: redis paths: - "%{environment}" options: host: xxxx soft_connection_failure: true 

我能用木偶查找解决木偶大师的钥匙:

 # puppet lookup 'app::params::git_repo_tag' --node node-c9cfeeac --environment production --render-as s pro 

了解更多信息:

 # puppet lookup 'app::params::git_repo_tag' --node node-c9cfeeac --environment production --trace --explain Searching for "lookup_options" Global Data Provider (hiera configuration version 5) Using configuration "/etc/puppetlabs/puppet/hiera.yaml" Hierarchy entry "redis" Path "/etc/puppetlabs/puppet/hieradata/production" Original path: "%{environment}" Module "app" not found Searching for "app::params::git_repo_tag" Global Data Provider (hiera configuration version 5) Using configuration "/etc/puppetlabs/puppet/hiera.yaml" Hierarchy entry "redis" Path "/etc/puppetlabs/puppet/hieradata/production" Original path: "%{environment}" Found key: "app::params::git_repo_tag" value: "pro" 

:我试图修复查找lookup_options,但在redis上添加数据没有工作。 我不知道是否以及以何种方式连接。

它也适用于编译。 现在,即使工作,当我实际上应用客户端在testing节点上,我有以下错误:

 # /opt/puppetlabs/bin/puppet agent -t Info: Using configured environment 'production' Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Function lookup() did not find a value for the name 'app::params::git_repo_tag' on node node-c9cfeeac Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run 

在我的木偶代码中,我指的是这样的var:

 repo_reference_to_pull => lookup('app::params::git_repo_tag'), 

:在我使用hiera()之前,但也是失败了,所以我决定更新代码。

我试过各种各样的hiera呼叫的组合:

 [...] repo_reference_to_pull => lookup( { 'name' => 'app::params::git_repo_tag','merge' => {'strategy' => 'first',},}), [...] 

但没有成功。 就像我说的,variablesCAN可以在puppetmaster上parsing,但不能从客户端parsing。

但是,以下调用也失败(使用–explain-options):

 # puppet lookup 'app::params::git_repo_tag' --node node-c9cfeeac --environment production --explain-options --trace Merge strategy hash Global Data Provider (hiera configuration version 5) Using configuration "/etc/puppetlabs/puppet/hiera.yaml" Hierarchy entry "redis" Path "/etc/puppetlabs/puppet/hieradata/production" Original path: "%{environment}" Module "app" not found 

我不明白什么是代理电话失败。 任何人都可以帮助解决这个问题?

注:我试图移动到mongo后端,但太旧了。 在mysql gem compilatin中,一个ruby版本不匹配失败。 此外,我正试图解决这个问题,而欢迎替代品是不是这个问题的范围。

谢谢大家的帮助。 🙂

==

技术信息:

硕士(docker工):

 # /opt/puppetlabs/puppet/bin/hiera --version 3.4.2 # /opt/puppetlabs/puppet/bin/puppet --version 5.3.2 

Hiera redis: https : //github.com/reliantsolutions/hiera-redis

 # /opt/puppetlabs/bin/puppetserver gem list *** LOCAL GEMS *** hiera (3.4.2) hiera-redis (2.0.1) jar-dependencies (0.2.6) jdbc-mysql (5.1.44) jruby-openssl (0.9.19 java) json (1.8.0 java) rake (10.1.0) rdoc (4.1.2) redis (3.3.5) 

客户:

 # /opt/puppetlabs/bin/puppet agent --version 5.3.2 

===