About | FAQ | Help
Ask Your Question
0

Puppet 5.4.0 on ubuntu 18.04 error could not find class

asked 2018-05-08 06:05:29 -0500

vaibhav gravatar image

updated 2018-05-08 07:44:59 -0500

Mr_Sharma gravatar image

I am using puppet standalone (5.4.0) on ubuntu 18.04. While running the mainfest file i get the error :

Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::xxxxxx for hostname_vai (file: test.pp, line: 10, column: 2) on node hostname_vai

the module is located in /usr/share/puppet/modules/ and the value for various puppet variables are :

basemodulepath = /lhome/sde/.puppet/etc/code/modules:/usr/share/puppet/modules
environmentpath = /lhome/sde/.puppet/etc/code/environments
factpath = /lhome/sde/.puppet/cache/lib/facter:/lhome/sde/.puppet/cache/facts
modulepath = /usr/share/puppet/modules
edit retag flag offensive close merge delete

Comments

Did you use puppet parser validate?

Mr_Sharma gravatar imageMr_Sharma ( 2018-05-08 07:49:55 -0500 )edit

Yes, it does not shows any error. Also the same script worked fine in ubuntu 16.04 with puppet 3.8

vaibhav gravatar imagevaibhav ( 2018-05-08 11:54:07 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-05-08 13:49:48 -0500

binford2k gravatar image

The class and module should follow the autoloading conventions. If the manifest defining the class doesn't exist where Puppet expects it to be, then it won't be found and you'll see this error.

Basically, if your class is named foo, and your $modulepath is /usr/share/puppet/modules, then the file must be located at /usr/share/puppet/modules/foo/manifests/init.pp and must declare a class foo.

However, you should validate those assumptions. I see that you're using puppet apply. You should check those settings by running puppet apply --configprint modulepath to see where Puppet is actually looking. Use --environment $name_of_your_env if you're not running against the production environment.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-05-08 06:05:29 -0500

Seen: 23 times

Last updated: May 08