我已经使用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'是不必要的。 –