Puppet hiera.yaml的查找配置的类型、条目和x27错误;层次结构';索引0需要一个结构值,获取字符串

Puppet hiera.yaml的查找配置的类型、条目和x27错误;层次结构';索引0需要一个结构值,获取字符串,puppet,hiera,r10k,Puppet,Hiera,R10k,这个安装程序以前运行过,但在我的服务器上重新安装Ubuntu 16.04并重新安装puppetserver和puppet代理后,我在尝试运行第一个代理时出错 错误:无法从远程服务器检索目录:服务器上的错误500:服务器错误:评估错误:评估函数调用时出错,查找键“Lookup_options”失败:“/etc/puppetlabs/puppet/hiera.yaml”处的查找配置类型错误,条目“hierarchy”索引0需要一个结构值,Get String “/etc/puppetlabs/pup

这个安装程序以前运行过,但在我的服务器上重新安装Ubuntu 16.04并重新安装puppetserver和puppet代理后,我在尝试运行第一个代理时出错

错误:无法从远程服务器检索目录:服务器上的错误500:服务器错误:评估错误:评估函数调用时出错,查找键“Lookup_options”失败:“/etc/puppetlabs/puppet/hiera.yaml”处的查找配置类型错误,条目“hierarchy”索引0需要一个结构值,Get String

“/etc/puppetlabs/puppet/hiera.yaml”处的查找配置的类型错误,条目“hierarchy”索引1需要一个结构值,即get String

“/etc/puppetlabs/puppet/hiera.yaml”处的查找配置具有错误的类型,无法识别的键“backends”

位于“/etc/puppetlabs/puppet/hiera.yaml”的查找配置在节点cclloyd.com上具有错误的类型、无法识别的键“yaml”(文件:/etc/puppetlabs/code/environments/production/site.pp,第1行,第1列)

/etc/puppetlabs/puppet/hiera.yaml:

---
# Hiera 5 Global configuration file

version: 5

:backends:
  - yaml
:hierarchy:
  - "nodes/%{::trusted.certname}"
  - common

:yaml:
  :datadir:
除了

,您的文件似乎是Hiera 3格式。Hiera 3可能会忽略“version”键并正常处理其余部分,但显然您现在正在运行Hiera 5。由于文件声明自己是Hiera 5格式,Hiera自然会一言不发。该配置的Hiera 5模拟将更像这样:

---
# Hiera 5 Global configuration file

version: 5

hierarchy:
  - name: "Per-node data (yaml version)"
    path: "nodes/%{::trusted.certname}"
  - name: "Common and fallback data"
    path: "common.yaml"

defaults:
  data_hash: yaml_data
请注意,“hierarchy”键的值是一个散列数组,并且(在Hiera 5中)它应该是“hierarchy”,而不是“:hierarchy”

或者,Hiera 5可能会接受您的原始文件,如果您只是简单地更改它以为原始内容指定正确的配置文件版本(3)。由于Hiera 3格式在Puppet 5中被弃用,并计划在Puppet 6中删除,因此,现在似乎是转换为新语法的好时机。

除了

,您的文件似乎是Hiera 3格式。Hiera 3可能会忽略“version”键并正常处理其余部分,但显然您现在正在运行Hiera 5。由于文件声明自己是Hiera 5格式,Hiera自然会一言不发。该配置的Hiera 5模拟将更像这样:

---
# Hiera 5 Global configuration file

version: 5

hierarchy:
  - name: "Per-node data (yaml version)"
    path: "nodes/%{::trusted.certname}"
  - name: "Common and fallback data"
    path: "common.yaml"

defaults:
  data_hash: yaml_data
请注意,“hierarchy”键的值是一个散列数组,并且(在Hiera 5中)它应该是“hierarchy”,而不是“:hierarchy”

或者,Hiera 5可能会接受您的原始文件,如果您只是简单地更改它以为原始内容指定正确的配置文件版本(3)。由于Hiera 3格式在Puppet 5中已被弃用,并计划在Puppet 6中删除,因此,现在似乎是转换为新语法的好时机