Ubuntu

Puppet 沒有應用配置但返回沒有錯誤

  • September 22, 2014

使用 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

您可能應該將 manifests/init.pp 重命名為 manifests/site.pp,因為這是您在 puppet.conf 中配置的

實際上是my.fqdnmaster知道代理的簽名證書名稱嗎?聽起來證書名稱可能與您的節點定義不匹配,因此它會忽略節點部分。

您可以嘗試強制代理報告的名稱,看看是否可以解決問題:

puppet agent --test --server my.fqdn --report --certname my.fqdn

引用自:https://serverfault.com/questions/511704