模块无法在无主系统上使用 r10k/puppet 执行

模块无法在无主系统上使用 r10k/puppet 执行

我关注本指南设置一个无主控的 Puppet 机器,可以使用 Puppet 进行自我管理(这样我以后可以添加节点并将其用作主控,但现在这无关紧要)。我设置了一个基本模块,应该检查以确保安装了 nginx 并且存在站点配置文件。但是当我使用 运行环境时sudo r10k deploy environment -p -v,它似乎更新了所有内容,但模块似乎无法正确执行。

我的模块可以找到这里,并且可以找到我的控制仓库这里

我的模块结构错误吗?我是不是漏掉了什么?是不是因为当我使用 Puppet 服务检查其状态时,sudo service puppet status我的文件出现了一些错误heira.yaml

● puppet.service - Puppet agent
   Loaded: loaded (/lib/systemd/system/puppet.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-02-22 23:07:06 UTC; 3min 0s ago
 Main PID: 19319 (puppet)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/puppet.service
           └─19319 /opt/puppetlabs/puppet/bin/ruby /opt/puppetlabs/puppet/bin/puppet agent --no-daemonize

Feb 22 23:07:06 puppeteer systemd[1]: Started Puppet agent.
Feb 22 23:07:07 puppeteer puppet-agent[19319]: Starting Puppet client version 5.4.0
Feb 22 23:07:09 puppeteer puppet-agent[19327]: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Lookup of key 'classes' failed:  The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, entry 'hierarchy' index 0 expects a Struct value, got String
Feb 22 23:07:09 puppeteer puppet-agent[19327]:   The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, entry 'hierarchy' index 1 expects a Struct value, got String
Feb 22 23:07:09 puppeteer puppet-agent[19327]:   The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, entry 'hierarchy' index 2 expects a Struct value, got String
Feb 22 23:07:09 puppeteer puppet-agent[19327]:   The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, unrecognized key 'backends'
Feb 22 23:07:09 puppeteer puppet-agent[19327]:   The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, unrecognized key 'yaml' (file: /etc/puppetlabs/code/environments/production/site.pp, line: 1, column: 1) on node puppeteer.c.personal-server-193919.internal
Feb 22 23:07:09 puppeteer puppet-agent[19327]: Applied catalog in 0.03 seconds

内容heira.yaml

---
# Hiera 5 Global configuration file

version: 5

# defaults:
#   data_hash: yaml_data
# hierarchy:
#  - name: Common
#    data_hash: yaml_data
#hierarchy: [] (tried with and without this commented out)
:backends:
  - yaml
:hierarchy:
  - "%{clientcert}"
  - "%{environment}"
  - global
:yaml:
  :datadir: '/etc/puppetlabs/puppet/environmets/%{environment}/hieradata'

相关内容