このセットアップは以前は機能していましたが、サーバーにUbuntu 16.04を再インストールし、puppetserverとpuppetエージェントを再インストールした後、最初のエージェントを実行しようとするとエラーが発生します。
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Lookup of key 'lookup_options' failed: The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, entry 'hierarchy' index 0 expects a Struct value, got String
The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, entry 'hierarchy' index 1 expects a Struct value, got String
The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, unrecognized key 'backends'
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 cclloyd.com
/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は「バージョン」キーをもっともらしく無視し、残りを通常どおり処理しますが、明らかにHiera 5を実行しているようです。その構成のHiera 5アナログは、次のようになります。
「階層」キーの値はハッシュの配列であり、(Hiera 5では)「:hierarchy」ではなく「階層」であることに注意してください。
または、Hiera 5は、元のコンテンツの正しい構成ファイルバージョン(3)を指定するように変更するだけで、元のファイルを受け入れる場合があります。 Hiera 3形式はPuppet 5で廃止され、Puppet 6で削除される予定であるため、新しい構文に変換するのに適した時期と思われます。