Puppet 使用类时出现错误

Puppet 使用类时出现错误,puppet,Puppet,我开始使用puppet来管理许多服务器,问题是每当我尝试使用一个类时,例如new relic: node 'mynode' { class {'newrelic::server::linux': newrelic_license_key => '***', } } 它失败,并返回以下错误: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet

我开始使用puppet来管理许多服务器,问题是每当我尝试使用一个类时,例如new relic:

node 'mynode' {
     class {'newrelic::server::linux':
       newrelic_license_key => '***',
      }
 }
它失败,并返回以下错误:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class newrelic::server::linux at /etc/puppet/manifests/site.pp:3 on node mynode

我已经在主机上安装了
fsalum newrelic
,当使用文件、包、服务等时,一切都正常。我做错了什么?

使用类似于“locate”的unix实用程序,找出您实际安装新puppet forge模块的位置

然后查看“basemodulepath”中的/etc/puppet/puppet.conf文件,并检查其安装位置是否在路径中

这是我的基本模块路径

basemodulepath = $confdir/environments/production/modules:$confdir/environments/production/local_modules:/etc/puppet/modules

我使用的外部模块要么在/etc/puppet/modules中,要么在/etc/puppet/environments/production/modules中,目录编译器将查找类
newrelic::server::linux
at
newrelic/manifests/server/linux.pp
相对于模块路径中的每个目录。(注意:
newrelic
,而不是
fsalum newrelic
)确保您确实安装了模块,以便在您的modulepath中存在这样一个文件,并确保它可被puppetmaster进程读取

还要注意的是,“puppetmaster进程可读”不仅仅意味着文件本身的所有权和权限。它还涉及该文件路径中所有目录的所有权和权限,以及可能的其他形式的访问控制,如ACL和SELinux conext和策略