![Puppet 未应用配置,但返回时没有错误](https://linux22.com/image/801906/Puppet%20%E6%9C%AA%E5%BA%94%E7%94%A8%E9%85%8D%E7%BD%AE%EF%BC%8C%E4%BD%86%E8%BF%94%E5%9B%9E%E6%97%B6%E6%B2%A1%E6%9C%89%E9%94%99%E8%AF%AF.png)
使用 Puppet 3.2.1 尝试设置服务器/客户端,并在同一主机上运行。
我也在使用 puppet-dashboard 和 puppetdb。
我的清单/init.pp:
node 'my.fqdn' {
file { '/tmp/test':
ensure => present
}
puppet agent --test --server my.fqdn --report
在 /etc/hosts 中定义 my.fqdn 和仪表盘的地方运行
产量:
Info: Retrieving plugin
Info: Loading facts in /etc/puppet/modules/concat/lib/facter/concat_basedir.rb
Info: Loading facts in /etc/puppet/modules/puppi/lib/facter/puppi_projects.rb
Info: Loading facts in /etc/puppet/modules/puppi/lib/facter/last_run.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppi_projects.rb
Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/last_run.rb
Info: Caching catalog for my.fqdn
Info: Applying configuration version '1369841032'
Notice: Finished catalog run in 0.08 seconds
Changes:
Events:
Resources:
Skipped: 6
Total: 7
Time:
Config retrieval: 0.42
Total: 0.42
Last run: 1369841033
Filebucket: 0.00
Version:
Config: 1369841032
Puppet: 3.2.1
文件/tmp/test
从未被创建!
还;
Puppet 仪表板表示它对任何节点都一无所知(EG 报告从未到达它)
puppet.conf 用于报告:
reports = store, http
reporturl = http://puppet.armed.us/reports/upload
这里可能发生什么事情?如何解决?
运行puppet apply /etc/puppet/manifests/init.pp
确实有效,但尝试从 Puppet Master 获取配置时无效。就像获取一个空白目录一样。
*编辑:
puppet.conf:
[main]
vardir = /var/lib/puppet
logdir = /var/log/puppet
rundir = /var/run/puppet
templatedir = /var/lib/puppet/templates
ssldir = $vardir/ssl
usecacheonfailure = true
user = puppet
group = puppet
[agent]
certname = my.fqdn
server = my.fqdn
pluginsync = true
report = true
reportserver = my.fqdn
summarize = true
graph = true
listen = false
runinterval = 1800
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig
[master]
masterport = 8140
bindaddress = 0.0.0.0
autosign = false
storeconfigs = true
environment = production
manifest = $confdir/manifests/site.pp
modulepath = /etc/puppet/modules:/usr/share/puppet/modules
storeconfigs_backend = puppetdb
reports = store, http
reporturl = http://my.fqdn/reports/upload
facts_terminus = active_record
和证书:
root@my:~# puppet cert list --all
+ "my.fqdn" (SHA256) E1:F0:29:1...:31:93:F9
答案1
您可能应该将 manifests/init.pp 重命名为 manifests/site.pp,因为这是您在 puppet.conf 中配置的内容
答案2
my.fqdn
实际上,主服务器知道代理的签名证书名称是什么?听起来证书名称可能与您的节点定义不匹配,因此它会忽略节点部分。
您可以尝试强制使用代理报告的名称,看看是否有效:
puppet agent --test --server my.fqdn --report --certname my.fqdn
答案3
我不知道您的网站是否也存在这种情况,但我需要 pluginsync = true,这样一些 puppet 配置才能正常工作。如果节点上的 /etc/puppet/puppet.conf 中没有该配置,puppet 运行不会失败,但不会执行我所期望的所有操作(例如,使用 file_line)。
我看到您将它放在了主 puppet.conf 上,但请检查它是否也在节点上。
答案4
您是否在节点 puppet.conf 的 [agent] 部分中放入了此指令(并重新启动)?report = true