#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    7
    Rep Power
    0

    Could not find class - puppet 2.7


    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

    Code:
    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
    }
    Code:
    manifests/nodes.pp
    
    node 'hostname' { include opendkim }
    and when I run puppet agent --test I get this:

    Code:
    $ sudo puppet agent --test
    err: Could not retrieve catalog from remote server:
    Error 400 on SERVER: Could not find class opendkim for hostname at
    /etc/puppet/manifests/nodes.pp:13 on node hostname warning:
    Not using cache on failed catalog err: Could not
    retrieve catalog; skipping run

    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 ?
    I was hoping that someone could shed some light on my issue or point me somewhere.
    Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Location
    Brooklyn, NYC
    Posts
    34
    Rep Power
    3
    What is in your puppet.conf on the master for 'modulepath=' ?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    7
    Rep Power
    0
    I figure it out. The problem is that I was using AWS ec2 instance with dynamic hostname without static ip and in that tier everytime you reboot your instance you get new dynamic name and simply there are 2 places that you need to make sure have new hostname in place:

    - /etc/hosts, /etc/puppet/puppet.conf & in my case /etc/puppet/manifests/nodes.pp

    Thanks for looking at my question and maybe that will save some trouble in the future.

    This thread can be closed.

IMN logo majestic logo threadwatch logo seochat tools logo