Could not find class

5,153 views
Skip to first unread message

Dmytro Bablinyuk

unread,
Dec 15, 2010, 8:48:47 PM12/15/10
to Puppet Users
Hi Everybody,

I am sure that I am missing something very obvious,

I have installed rsync package

git clone https://github.com/camptocamp/puppet-rsyncd.git rsync

The path

root@puppet-master:/etc/puppet/modules/rsync/manifests/classes# ls -l
total 4
-rw-r--r-- 1 root root 1078 2010-12-16 09:54 rsyncd.pp

The manifest file

package { ["rsync", "xinetd"]: ensure => present }
service { "xinetd": ensure => running }

include rsyncd

rsyncd::export { "etc":
path => "/etc",
chroot => true,
gid => "staff",
allow => ["172.16.50.4", "172.16.41.10"],
}

I have error on the client

root@puppet-client-ubuntu:~# puppetd --test
info: Retrieving plugin
err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Could not find class rsyncd at /etc/puppet/manifests/site.pp:
33 on node puppet-client-ubuntu.harbour
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

How do I specify path to the rsyncd class?

Thank you
Dmytro

Daniel Piddock

unread,
Dec 16, 2010, 4:51:50 AM12/16/10
to puppet...@googlegroups.com

The "include rsyncd" line causes Puppet to look for
/etc/puppet/modules/rsyncd/manifests/init.pp which you don't have. Try
renaming the rsync checkout folder to rsyncd.

Dan

luke.bigum

unread,
Dec 16, 2010, 4:58:49 AM12/16/10
to Puppet Users
That github link doesn't work for me so don't know the internals of
this module, but if the module is called "rsync", as indicated by this
module path: /etc/puppet/modules/rsync/, then any sub classes of that
should be in the rsync namespace... Are you sure it's not supposed to
be rsync::rsyncd?

A base class called 'rsyncd' would mean there'd be a module etc/puppet/
modules/rsync/rsyncd/, not a "rsyncd.pp" under the rsync module...
What you've shown of this module's structure looks quite strange to
me.

luke.bigum

unread,
Dec 16, 2010, 5:39:42 AM12/16/10
to Puppet Users
Dmytro,

I'm a git noob :) I've had a look at the module now. I wouldn't say
it's designed that well and I think a few people on this list would
agree.

To fix your problem I think you'll have to "include rsync" first,
which will then import "classes/*.pp", which will then allow Puppet to
find the rsyncd class. This is a bad design as rsyncd should really be
it's own module or a subclass rather than relying on including a class
that actually does nothing but import other .pp files.

When thinking about the rsync software itself, the module could be
designed better. You can't have just an rsync client with this module
(ie: just Package[rsync]), you only get an rsync server. That means if
you wanted to Puppetify an rsync client you'd need another module/
class, which would then leave to multiple declaration problems if a
node is a client AND a server as both would try declare
Package[rsync]. A better idea would be something like this:

class rsync
installs rsync software
class rsync::rsyncd
include rsync (for the software)
turns on rsyncd, contains a define to setup rsyncd exports

And the actual module structure would look like this, which requires
zero "import" statements:

modules/rsync/init.pp <- contains "class rsync"
modules/rsync/rsyncd.pp <- contains "class rsync::rsyncd"

Lastly, I personally don't like the name of the define
"rsyncd::export" as the double colon kind of denotes they are parent
and child classes, but that's just me.

Anyway, if you really want to use this module you could try "include
rsync" before "include rsyncd". You will have to remove your own
declaration of Package[rsync] as this is already done in the rsyncd
module and will cause a multiple declaration error.

My recommendation is to write a better module yourself, you'll learn
more that way :)

Hope this helps,

-Luke

Dmytro Bablinyuk

unread,
Dec 16, 2010, 6:08:47 PM12/16/10
to Puppet Users
Thank you very much!
It's working now.
Indeed when I have some spare time I may attempt to write another
module.

Dmytro

devaki prabhu

unread,
May 6, 2014, 6:44:39 AM5/6/14
to puppet...@googlegroups.com
Hi everybody,

i have to install keystone package on puppet client :
i have some module  in puppet master /etc/puppet/modules/keystone/manifests/init.pp
and when i include it in client ,getting an class not found.
any help is accepted.
Thank you.

                                                                                                                                       152,5         34%

jcbollinger

unread,
May 6, 2014, 10:22:34 AM5/6/14
to puppet...@googlegroups.com


On Tuesday, May 6, 2014 5:44:39 AM UTC-5, devaki prabhu wrote:
Hi everybody,

i have to install keystone package on puppet client :
i have some module  in puppet master /etc/puppet/modules/keystone/manifests/init.pp
and when i include it in client ,getting an class not found.
any help is accepted.



Step 1.  Avoid disturbing the dead.  This thread died three and a half years ago!  Start your own thread for your own question.

Step 2.  In the new thread where you are going to pose your question, post the specific error message and the relevant code.  The relevant code includes the node block (or other means) by which you are assigning the class to the node, and the fully-qualified name and contents of the manifest file containing the definition of the class in question.  The Puppet code can be abbreviated if it is long -- the class declaration and the beginning of the class definition or the most important parts.


John
 
Reply all
Reply to author
Forward
0 new messages