木偶:如何解决“无效的资源typesfile_line”?

我有一个新configuration的Puppet服务器,只configuration了一个模块和一个受pipe客户端。

这是一个MOTD模块,看起来像这样:

class motd { file { "/etc/custom_motd.sh": path => '/etc/custom_motd.sh', ensure => present, owner => "root", group => "root", mode => "775", content => template('motd/custom_motd.sh.erb'), #require => Class['nagios_client'], } # file_line { 'enable motd': # ensure => present, # line => '/etc/custom_motd.sh', # path => '/etc/profile', # require => File['/etc/custom_motd.sh'] # } } 

当我在客户端运行puppet agent -t时,我得到了正确的结果:

 [root@pnd01 ~]# puppet agent -t Info: Retrieving pluginfacts Info: Retrieving plugin Info: Caching catalog for pnd01.company.com Info: Applying configuration version '1426413575' Notice: /Stage[main]/Motd/File[/etc/custom_motd.sh]/ensure: created Notice: Finished catalog run in 0.24 seconds [root@pnd01 ~]# 

但是,如果我取消注释模块的init.pp文件中的“文件行”部分,然后在客户端上运行puppet agent -t ,我会得到以下响应:

 [root@pnd01 ~]# puppet agent -t Info: Retrieving pluginfacts Info: Retrieving plugin Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type file_line at /etc/puppet/environments/production/modules/motd/manifests/init.pp:17 on node pnd01.company.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run [root@pnd01 ~]# 

第17行指向“file_line”声明。 我在另一个Puppet环境中有完全相同的模块,它在那里工作就像一个魅力。 我在Google上查了一下,发现一个postbuild议添加:

 pluginsync = true 

到客户端机器上/etc/puppet/puppet.conf[main]部分,我已经这么做了,但是我仍然得到了同样的错误。

任何想法如何解决这个问题,或者为什么它甚至发生?

您可能需要安装标准库 。 在你的其他安装中,这可能是由你安装的其他模块引入的。

之后,使用它include stdlib