我正在關注本指南設定一個無主的木偶機器,可以使用木偶來管理自身(以某種方式讓我添加節點並稍後將其用作主機,但現在無關緊要)。我設定了一個基本模組,應該檢查以確保 nginx 已安裝並且網站設定檔存在。但是當我使用運行環境時sudo r10k deploy environment -p -v
,它似乎更新了所有內容,但模組似乎沒有正確執行。
我的模組結構是否錯誤?我在這裡錯過了什麼嗎?是因為當我使用它來檢查木偶服務的狀態時,它會在我的文件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'