Ask Your Question

Could not find class , but explicit import in site.pp works

asked 2014-09-04 00:36:33 -0500

Ath gravatar image


I am facing an issue where puppet client can not find a module create in /etc/puppet/modules

**puppet config print modulepath**

I have a Puppet set up where I have created a module in


cat /etc/puppet/modules/users/manifests/init.pp
class moduleuser {
        user { 'maddy':
                 ensure => present,
                 uid => '508',
                 gid => 'root',
                 shell => '/bin/ksh',

From the client(which is a separate UBUNTU machine), I run

puppet agent --no-daemonize --onetime --verbose

and I get an error, Info: Retrieving plugin Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class moduleusers for test.home on node test.home

However, if I import init.pp into site.pp file in the puppet master everything works fine.

cat /etc/puppet/manifests/site.pp
import 'emacs.pp'
import 'users.pp'
import 'irexample.pp'
import 'removepackage.pp'
import 'removedir.pp'
import '/etc/puppet/modules/users/manifests/init.pp'

node default {

node "test" {
                include moduleuser


Is this behavior Normal ?



edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-09-04 07:43:58 -0500

llowder gravatar image

Yes, this is normal.

You don't have the module setup in such a way that the autoloader can find it.

You have the class named moduleuser but on the filesystem the module is named users, and those need to match - both will need to be either users or moduleuser.

Please refer to the module cheat sheet and the (classic) Learning Puppet section on module structure for more information.

edit flag offensive delete link more


Thanks, I tested it and it works perfectly fine. Thanks again for your time and answer

Ath gravatar imageAth ( 2014-09-04 13:22:32 -0500 )edit

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


Asked: 2014-09-04 00:34:28 -0500

Seen: 1,320 times

Last updated: Sep 04 '14