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 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
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-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hm, I thought that puppet would search for filname X in module Y manifestdir when you included a class like include "Y::X", guess I''m wrong there. On the other hand, adding the import statement in the beginning of rhnsd/manifests/init.pp yeilds the same error. On 17 Jun, 13:10, Silviu Paragina <sil...@paragina.ro> wrote:> 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-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 2010-06-17 06: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 you really pasted this, then here is your error ;) I saw the same typo in client.pp higher up.> > 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 >-- Gabriel Filion -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Silviu Paragina
2010-Jun-17 18:26 UTC
Re: [Puppet Users] Re: Could not find class, code-blind
Just to be sure we''re on the same page. It doesn''t work like this? init.pp:: import "*" class rhnsd { } Is the module path in puppet set to your module path? Other than this I can''t spot any other errors. Also make sure you have restarted puppetmasterd, in many cases when developing puppet code restarts are required for the puppetmasterd. (or at least they were required, and it became a best practice for me :">) Silviu On 17.06.2010 14:28, Tore wrote:> Hm, I thought that puppet would search for filname X in module Y > manifestdir when you included a class like include "Y::X", guess I''m > wrong there. > > On the other hand, adding the import statement in the beginning of > rhnsd/manifests/init.pp yeilds the same error. > > On 17 Jun, 13:10, Silviu Paragina<sil...@paragina.ro> wrote: > >> 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-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Darn it. now I see the typo. I looked at your comment for 5 mins before i noticed. Oh well :) Thanks alot! On 17 June 2010 19:55, Gabriel Filion <lelutin@gmail.com> wrote:> On 2010-06-17 06: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 you really pasted this, then here is your error ;) > > I saw the same typo in client.pp higher up. > > > > > 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 > > > > > -- > Gabriel Filion >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.