Ask Your Question
1

could not find class

asked 2013-06-05 11:10:02 -0500

greywindow gravatar image

updated 2013-06-05 12:29:03 -0500

ramindk gravatar image

Hello,

I'm using puppet-2.7.10-1 on CentOs 6.3, working on new module and I'm following this structure:

opendkim/
├── files
│   └── etc
│       └── opendkim
│           └── keys
├── manifests
│   ├── config.pp
│   ├── init.pp
│   ├── install.pp
│   ├── params.pp
│   └── service.pp
└── templates
    └── etc
        ├── init.d
        │   └── opendkim.erb
        └── opendkim
            ├── KeyTable.erb
            ├── opendkim.conf.erb
            ├── SigningTable.erb

opendkim/manifests/init.pp

 # Class: opendkim
 #
 # This class installs opendkim
 #
 # Actions:
 #   Installs opendkim
 class opendkim {

    include opendkim::install
    include opendkim::params
    include opendkim::config
    include opendkim::service
}

manifests/nodes.pp

node 'hostname' { include opendkim }

and when I run puppet agent --test I get this:

$ sudo puppet agent --test
err ...
(more)
edit retag flag offensive close merge delete

Comments

In your code above it appears that you have class opendkim { commented out. Is that actually the case or is it a typo in your paste?

ramindk gravatar imageramindk ( 2013-06-05 11:38:34 -0500 )edit

I'm sorry for that, somehow copy & paste didn't work. Fixed in the post and 'class opendkim' is not commented out. Thanks

greywindow gravatar imagegreywindow ( 2013-06-05 11:57:16 -0500 )edit

What's the full path of opendkim/manifests/init.pp ? Puppet will normally assume it's /etc/puppet/modules/opendkim/manifests/init.pp

ramindk gravatar imageramindk ( 2013-06-05 12:48:22 -0500 )edit

-rwxr-x---. 1 puppet puppet /etc/puppet/modules/opendkim/manifests/init.pp

greywindow gravatar imagegreywindow ( 2013-06-05 13:10:51 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2013-06-05 12:38:16 -0500

greywindow gravatar image

Another odd thing is that in order to make it work I have to specify class in /etc/puppet/manifests/site.pp file where is completely different from the following approach:

<module-name>
├── manifests
│   ├── config.pp
│   ├── init.pp
│   ├── install.pp
│   ├── params.pp
│   └── service.pp

Is there a place where you can define where to put classes or puppet should be smart enough to recognize statement "class <class-name>" in every .pp file ?

Thanks

edit flag offensive delete link more

Comments

What is in your puppet.conf on the master for 'modulepath=' ?

bmurts gravatar imagebmurts ( 2013-06-07 11:01:37 -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

Stats

Asked: 2013-06-05 11:10:02 -0500

Seen: 1,630 times

Last updated: Jun 05 '13