我正在使用 ruby 脚本来检索类参数,我的 YAML 输出如下:
classes:
tomcat_install:
tmp_dir: /tmp
tomcat_home: /tmp/tomcat6
puppet.conf
如下:
[master]
node_terminus = exec
external_nodes = /etc/puppet/readnodedefinitions.rb
当我从 Puppet 代理发出测试命令时,日志是:
Notice: Ignoring --listen on onetime run
Info: Retrieving plugin
Info: Caching catalog for puppet-agent
Info: Applying configuration version '1367987990'
Notice: Finished catalog run in 0.06 seconds
但是 ruby 脚本中指定的类被忽略了。知道为什么会被忽略吗?
调试模式给出了这个
Debug: Finishing transaction 69977541744660
Debug: Loaded state in 0.00 seconds
Debug: node supports formats: b64_zlib_yaml pson raw yaml; using pson
Debug: Using cached certificate for ca
Debug: Using cached certificate for puppet-agent.cs1cloud.internal
Debug: Using cached certificate_revocation_list for ca
Info: Retrieving plugin
Debug: file_metadata supports formats: b64_zlib_yaml pson raw yaml; using pson
Debug: Finishing transaction 69977541525360
Debug: catalog supports formats: b64_zlib_yaml dot pson raw yaml; using pson
Info: Caching catalog for puppet-agent.cs1cloud.internal
Debug: Creating default schedules
Debug: Loaded state in 0.00 seconds
Info: Applying configuration version '1367987990'
Debug: /Schedule[daily]: Skipping device resources because running on a host
Debug: /Schedule[monthly]: Skipping device resources because running on a host
Debug: /Schedule[hourly]: Skipping device resources because running on a host
Debug: /Schedule[never]: Skipping device resources because running on a host
Debug: /Schedule[weekly]: Skipping device resources because running on a host
Debug: /Schedule[puppet]: Skipping device resources because running on a host
Debug: Finishing transaction 69977541711700
Debug: Storing state
Debug: Stored state in 0.03 seconds
Notice: Finished catalog run in 0.07 seconds
Debug: Value of 'preferred_serialization_format' (pson) is invalid for report, u sing default (b64_zlib_yaml)
Debug: report supports formats: b64_zlib_yaml raw yaml; using b64_zlib_yaml
答案1
看来您的 YAML 输出丢失了一些内容-
,Puppet 无法将其识别为 YAML 文件。也许它应该这样?
---
classes:
puppet-agent.cs1cloud.internal:
tmp_dir: /tmp
tomcat_home: /tmp/tomcat6