2017-10-29 80 views
0

我試圖編輯我的木偶代理入住時間,但無法讓它運行命令ini_settting我一直在關注本指南作爲示例: linkPuppet:評估資源聲明時出錯,未知資源類型:'ini_setting'

ini_setting {'server_true': 
    path => '/tmp/server.conf', 
    section => 'main', 
    setting => 'server', 
    value => 'true', 
    } 

然而,當我運行ini_setting什麼,我得到:錯誤:服務器錯誤500:無法檢索從遠程服務器的目錄服務器錯誤:評估錯誤:錯誤而評估資源語句,未知的資源在/etc/puppetlabs/code/environments/production/manifests/test.pp輸入:'ini_setting'

我也試過在一個類中聲明它,並且有同樣的錯誤。我也嘗試了inifile::setting { 'agent_runinterval':從這個指南link與同樣的問題。

我入住代碼如下所示:

test.pp

ini_setting { "agent_runinterval": 
     ensure => present, 
     path => "/etc/puppetlabs/puppet/puppet.conf", 
     section => "main", 
     settting => "runinterval", 
     value => "21600" 
} 

我檢查了配置文件被正確定位:

cat /etc/puppetlabs/puppet/puppet.conf 
# This file can be used to override the default puppet settings. 

按照傀儡docs我應該能夠添加runinterval到主

注意:我不想在這裏手動更改配置文件。

謝謝!

+2

你沒有明確提到它,你安裝了[inifile module](https://forge.puppet.com/puppetlabs/inifile)嗎? – larsks

+0

@larsks謝謝!我以爲我是在我的基礎木偶安裝模板中使用它,但事實證明它一路上失敗了。現在好,再次感謝。 – Ben

回答

1

按照上面的Larsks的想法,原來模塊一路上都失敗了。

手動安裝使用puppet module install puppetlabs-inifile --version 2.0.0,一切都很好。再次感謝。