我已經使用Vagrant在Oracle VirtualBox中設置了Puppet主/代理,並且根據the README中的說明在主代理和代理上安裝了netdev_stdlib
。Puppet netdev_stdlib:如何解決「無效的資源類型netdev_device」?
我已經設置了模塊路徑/etc/puppet/modules/netdev_stdlib
,其中標準庫stdlib
也存在。
主節點爲puppet.example.com
,代理爲node01.example.com
。
我的清單文件如下:
node default {
file { "/tmp/example_ip": ensure => present }
include stdlib # No error on this line
# include netdev_stdlib # Uncomment this line will cause error
netdev_device { $hostname: }
}
然而,當我我得到了
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type netdev_device at /etc/puppet/manifests/site.pp:17 on node node01.example.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run
客戶端我試圖在清單文件site.pp
使用include netdev_stdlib
上運行puppet agent -t
,但木偶couldn找不到類netdev_stdlib
。但是,include stdlib
是好的。
對不起,清單文件site.pp格式被搞砸了,我的觀點是文件'/ tmp/example_ip'能夠在主服務器和代理之間同步,所以文件很好,但是在添加netdev_device {$ hostname:}之後代理(或主服務器?)無法識別netdev_stdlib應該附帶的資源「netdev_device」。 – luke
你在使用舞臺嗎?否則'包括stdlib'是不必要的。 –