On 17.06.2010 13:31, Tore wrote:
I'm troubled with a node-definition not able to resolve a class:
  Could not find class rhnsd::common at /etc/puppet/manifests/nodes.pp:
8 on node X

Content of manifest/site.pp:
import "nodes.pp"
[...]

The layout of modules/rhnsd/ is:
|-- files
|   `-- up2date-rhn
|-- manifests
|   |-- client.pp
|   |-- common.pp
|   |-- init.pp
|   `-- rhn.pp

A `cat' from each manifest file:
client.pp::
class rhnds::client inherits rhnsd::common {

         service { "rhnsd":
                 ensure          =>  running,
                 enable          =>  true,
                 hasrestart      =>  true,
                 hasstatus       =>  true,
                 require         =>  [ Package["rhnsd"], File["/etc/
sysconfig/rhn/up2date"] ],
                 subscribe       =>  File["/etc/sysconfig/rhn/up2date"],
         }

}

common.pp::
class rhnds::common inherits rhnsd {

         if ($operatingsystem != 'RedHat') {
                 fail("${fqdn} is not an RedHat OS, it is $
{operatingsystem}. Unable to apply module RHN, since it is only used
on RedHat based systems")
         }

         if ($lsbmajdistrelease != '5') {
                 fail("${fqdn} is not a 5-major release from RedHat.
Puppet modules for other major releases have not been made yet.")
         }

         $rhn_client_requirements = $lsbmajdistrelease ? {
                 5 =>  [ 'yum', 'rhn_register', 'rhnsd' ],
                 4 =>  [ 'yum', 'up2date', 'rhnsd' ],
         }

         package { $rhn_client_requirements:
                 ensure  =>  present,
         }

}

init.pp::
class rhnsd {

}


client.pp::
class rhnsd::client::rhn inherits rhnsd::client {

         file { "/etc/sysconfig/rhn/up2date":
                 ensure  =>  present,
                 source  =>  "puppet:///rhn/up2date-rhn",
                 require =>  File["/usr/share/rhn/RHNS-CA-CERT"],
         }

         file { "/usr/share/rhn/RHNS-CA-CERT-VISMA":
                 ensure  =>  present,
                 source  =>  "puppet:///rhn/RHNS-CA-CERT",
         }

}


Why wont this work, I know it must be an small error, but right now im
code-blind, it sucks.

Thanks for your help

Try adding in init.pp:
import "*"

The other files in the manifest directory are not included by default ;)


Silviu

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to