简体   繁体   中英

Puppet error when using classes

I am starting using puppet to manage many servers, the problem is that whenever I try to use a class, new relic for example:

node 'mynode' {
     class {'newrelic::server::linux':
       newrelic_license_key => '***',
      }
 }

It fails, and returns the following error:

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

I have installed fsalum-newrelic on the master, and everything works fine when using files, packages, services etc. What am I doing wrong?

The catalog compiler will look for class newrelic::server::linux at newrelic/manifests/server/linux.pp relative to each directory in your module path. (Note: newrelic , NOT fsalum-newrelic .) Make certain that you indeed did install the module such that such a file exists in your modulepath, and make sure that it is readable by the puppetmaster process.

Note, too, that "readable by the puppetmaster process" means more than just the ownership and permissions of the file itself. It also involves ownership and permissions of all the directories in the path to that file, and possibly other forms of access control, such as ACLs and SELinux conext and policy.

Find out where you are actually installing the new puppet forge modules using perhaps a unix utility like "locate".

Then look in the the /etc/puppet/puppet.conf at the "basemodulepath" and check that the place it is installed is in the path

Here is my basemodulepath

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

The external modules I am using are either in /etc/puppet/modules or in /etc/puppet/enviroments/production/modules

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM