Hi, I am having trouble getting puppet to find a class thats defined in one of the modules.I have a module/folder called ''webserver'' in /etc/ puppet/modules/, which has a init.pp file with the below content class webserver{ file {''test.txt'': path => ''/etc/test.txt'', ensure => present, mode => 0640, source => "puppet:///webserver/test.txt" } } I have a nodes.pp file with node basenode { include webserver } node ''puppet-client02.eng.xyz.com''inherits basenode { } node ''puppet-client.eng.xyz.com''inherits basenode { And the site.pp, file has -SNIP- import "modules" import "nodes" -SNIP- when I run the puppet on the client i get an error message: err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of resource: Could not retrieve information from source(s) puppet://puppet/plugins err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class webserver at /etc/puppet/manifests/ nodes.pp:3 on node puppet-client.eng.xyz.com warning: Not using cache on failed catalog err: Could not retrieve catalog; skipping run Whats wrong here?, why cant puppet find the class ''webserver'', i have checked with puppet--chkconfig modulepath, and the path is /etc/puppet/ modules 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 Wed, Oct 12, 2011 at 2:31 PM, Boskey <boskey@gmail.com> wrote:> Hi, > > I am having trouble getting puppet to find a class thats defined in > one of the modules.I have a module/folder called ''webserver'' in /etc/ > puppet/modules/, which has a init.pp file with the below content > > class webserver{ > file {''test.txt'': > path => ''/etc/test.txt'', > ensure => present, > mode => 0640, > source => "puppet:///webserver/test.txt" > } > }The code above should be located in /etc/puppet/modules/webserver/manifests/init.pp Move the test.txt to /etc/puppet/modules/webserver/files/test.txt and update your source to: puppet:///modules/webserver/test.txt> I have a nodes.pp file with > > node basenode { > include webserver > } > > node ''puppet-client02.eng.xyz.com''inherits basenode { > } > > node ''puppet-client.eng.xyz.com''inherits basenode { > > > And the site.pp, file has > > -SNIP- > import "modules" > import "nodes" > -SNIP-You don''t need either import statement. HTH, Nan -- 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 Oct 12, 2011, at 2:31 PM, Boskey wrote:> Hi, > > I am having trouble getting puppet to find a class thats defined in > one of the modules.I have a module/folder called ''webserver'' in /etc/ > puppet/modules/, which has a init.pp file with the below content > > class webserver{ > file {''test.txt'': > path => ''/etc/test.txt'', > ensure => present, > mode => 0640, > source => "puppet:///webserver/test.txt" > } > } > > I have a nodes.pp file with > > node basenode { > include webserver > } > > node ''puppet-client02.eng.xyz.com''inherits basenode { > } > > node ''puppet-client.eng.xyz.com''inherits basenode { > > > And the site.pp, file has > > -SNIP- > import "modules" > import "nodes" > -SNIP- > > when I run the puppet on the client i get an error message: > > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > resource: Could not retrieve information from source(s) puppet://puppet/plugins > err: Could not retrieve catalog from remote server: Error 400 on > SERVER: Could not find class webserver at /etc/puppet/manifests/ > nodes.pp:3 on node puppet-client.eng.xyz.com > warning: Not using cache on failed catalog > err: Could not retrieve catalog; skipping run > > > Whats wrong here?, why cant puppet find the class ''webserver'', i have > checked with puppet--chkconfig modulepath, and the path is /etc/puppet/ > modules---- Do these files exist in this path? /etc/puppet/modules/webserver/manifests/init.pp /etc/puppet/modules/webserver/files/test.txt also, source? source => "puppet:///modules/webserver/test.txt" Craig -- 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 Oct 13, 8:30 am, Craig White <craig.wh...@ttiltd.com> wrote:> On Oct 12, 2011, at 2:31 PM, Boskey wrote: > > > > > > > > > > > Hi, > > > I am having trouble getting puppet to find a class thats defined in > > one of the modules.I have a module/folder called ''webserver'' in /etc/ > > puppet/modules/, which has a init.pp file with the below content > > > class webserver{ > > file {''test.txt'': > > path => ''/etc/test.txt'', > > ensure => present, > > mode => 0640, > > source => "puppet:///webserver/test.txt" > > } > > } > > > I have a nodes.pp file with > > > node basenode { > > include webserver > > } > > > node ''puppet-client02.eng.xyz.com''inherits basenode { > > } > > > node ''puppet-client.eng.xyz.com''inherits basenode { > > > And the site.pp, file has > > > -SNIP- > > import "modules" > > import "nodes" > > -SNIP- > > > when I run the puppet on the client i get an error message: > > > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > > resource: Could not retrieve information from source(s) puppet://puppet/plugins > > err: Could not retrieve catalog from remote server: Error 400 on > > SERVER: Could not find class webserver at /etc/puppet/manifests/ > > nodes.pp:3 on node puppet-client.eng.xyz.com > > warning: Not using cache on failed catalog > > err: Could not retrieve catalog; skipping run > > > Whats wrong here?, why cant puppet find the class ''webserver'', i have > > checked with puppet--chkconfig modulepath, and the path is /etc/puppet/ > > modules > > ---- > Do these files exist in this path? > > /etc/puppet/modules/webserver/manifests/init.pp > /etc/puppet/modules/webserver/files/test.txt > > also, source? > > source => "puppet:///modules/webserver/test.txt" > > Craig@nan and Craig, Yes those files exist in the paths, sorry about the confusing statement, but their is a : /etc/puppet/modules/webserver/manifests/init.pp /etc/puppet/modules/webserver/files/test.txt And I did change the Source to add ''modules'' path in it, still getting the same error message, it looks like Puppet cant find my modules although they are in the right path. -- 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 Mon, Oct 17, 2011 at 2:34 PM, Boskey <boskey@gmail.com> wrote:>> > Hi, >> >> > I am having trouble getting puppet to find a class thats defined in >> > one of the modules.I have a module/folder called ''webserver'' in /etc/ >> > puppet/modules/, which has a init.pp file with the below content >> >> > class webserver{ >> > file {''test.txt'': >> > path => ''/etc/test.txt'', >> > ensure => present, >> > mode => 0640, >> > source => "puppet:///webserver/test.txt" >> > } >> > } >> >> > I have a nodes.pp file with >> >> > node basenode { >> > include webserver >> > } >> >> > node ''puppet-client02.eng.xyz.com''inherits basenode { >> > } >> >> > node ''puppet-client.eng.xyz.com''inherits basenode { >> >> > And the site.pp, file has >> >> > -SNIP- >> > import "modules" >> > import "nodes" >> > -SNIP- >> >> > when I run the puppet on the client i get an error message: >> >> > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of >> > resource: Could not retrieve information from source(s) puppet://puppet/plugins >> > err: Could not retrieve catalog from remote server: Error 400 on >> > SERVER: Could not find class webserver at /etc/puppet/manifests/ >> > nodes.pp:3 on node puppet-client.eng.xyz.com >> > warning: Not using cache on failed catalog >> > err: Could not retrieve catalog; skipping run >> >> > Whats wrong here?, why cant puppet find the class ''webserver'', i have >> > checked with puppet--chkconfig modulepath, and the path is /etc/puppet/ >> > modules >> >> ---- >> Do these files exist in this path? >> >> /etc/puppet/modules/webserver/manifests/init.pp >> /etc/puppet/modules/webserver/files/test.txt >> >> also, source? >> >> source => "puppet:///modules/webserver/test.txt" >> >> Craig > > @nan and Craig, > > Yes those files exist in the paths, sorry about the confusing > statement, but their is a : > /etc/puppet/modules/webserver/manifests/init.pp > /etc/puppet/modules/webserver/files/test.txt > > And I did change the Source to add ''modules'' path in it, still getting > the same error message, it looks like Puppet cant find my modules > although they are in the right path.Are you using puppet enterprise? What''s the output of puppet master --configprint modulepath? Can the puppet master daemon user (either puppet or pe-puppet) traverse and read the files in the modules directory? Thanks, Nan -- 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.
Check permissions :-) The puppet master must be able to read the files and the paths to get to them. But, today I''ve beiin hit with this... after a 2.6.x to 2.7.x upgrade, puppet with forman said it couldn''t find some classes that were there before. Removing and re-adding the class works for awhile, then it lost it again. But, it''s only happening on one node of 200+. On Mon, Oct 17, 2011 at 6:15 PM, Nan Liu <nan@puppetlabs.com> wrote:> On Mon, Oct 17, 2011 at 2:34 PM, Boskey <boskey@gmail.com> wrote: > >> > Hi, > >> > >> > I am having trouble getting puppet to find a class thats defined in > >> > one of the modules.I have a module/folder called ''webserver'' in /etc/ > >> > puppet/modules/, which has a init.pp file with the below content > >> > >> > class webserver{ > >> > file {''test.txt'': > >> > path => ''/etc/test.txt'', > >> > ensure => present, > >> > mode => 0640, > >> > source => "puppet:///webserver/test.txt" > >> > } > >> > } > >> > >> > I have a nodes.pp file with > >> > >> > node basenode { > >> > include webserver > >> > } > >> > >> > node ''puppet-client02.eng.xyz.com''inherits basenode { > >> > } > >> > >> > node ''puppet-client.eng.xyz.com''inherits basenode { > >> > >> > And the site.pp, file has > >> > >> > -SNIP- > >> > import "modules" > >> > import "nodes" > >> > -SNIP- > >> > >> > when I run the puppet on the client i get an error message: > >> > >> > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > >> > resource: Could not retrieve information from source(s) > puppet://puppet/plugins > >> > err: Could not retrieve catalog from remote server: Error 400 on > >> > SERVER: Could not find class webserver at /etc/puppet/manifests/ > >> > nodes.pp:3 on node puppet-client.eng.xyz.com > >> > warning: Not using cache on failed catalog > >> > err: Could not retrieve catalog; skipping run > >> > >> > Whats wrong here?, why cant puppet find the class ''webserver'', i have > >> > checked with puppet--chkconfig modulepath, and the path is > /etc/puppet/ > >> > modules > >> > >> ---- > >> Do these files exist in this path? > >> > >> /etc/puppet/modules/webserver/manifests/init.pp > >> /etc/puppet/modules/webserver/files/test.txt > >> > >> also, source? > >> > >> source => "puppet:///modules/webserver/test.txt" > >> > >> Craig > > > > @nan and Craig, > > > > Yes those files exist in the paths, sorry about the confusing > > statement, but their is a : > > /etc/puppet/modules/webserver/manifests/init.pp > > /etc/puppet/modules/webserver/files/test.txt > > > > And I did change the Source to add ''modules'' path in it, still getting > > the same error message, it looks like Puppet cant find my modules > > although they are in the right path. > > Are you using puppet enterprise? What''s the output of puppet master > --configprint modulepath? Can the puppet master daemon user (either > puppet or pe-puppet) traverse and read the files in the modules > directory? > > Thanks, > > Nan > > -- > 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. > >-- 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.
Sorry, it does not help with the problem, but some time ago, i think i had something similar. I had a module+class which is perfectly working, and which was included in the node code. But if this class was in included in another class, it could not be found and puppet run failed. I had no choice but to include it at the node level for it to be found and included. 2011/10/13 Nan Liu <nan@puppetlabs.com>> On Wed, Oct 12, 2011 at 2:31 PM, Boskey <boskey@gmail.com> wrote: > > Hi, > > > > I am having trouble getting puppet to find a class thats defined in > > one of the modules.I have a module/folder called ''webserver'' in /etc/ > > puppet/modules/, which has a init.pp file with the below content > > > > class webserver{ > > file {''test.txt'': > > path => ''/etc/test.txt'', > > ensure => present, > > mode => 0640, > > source => "puppet:///webserver/test.txt" > > } > > } > > The code above should be located in > /etc/puppet/modules/webserver/manifests/init.pp > > Move the test.txt to /etc/puppet/modules/webserver/files/test.txt and > update your source to: > puppet:///modules/webserver/test.txt > > > I have a nodes.pp file with > > > > node basenode { > > include webserver > > } > > > > node ''puppet-client02.eng.xyz.com''inherits basenode { > > } > > > > node ''puppet-client.eng.xyz.com''inherits basenode { > > > > > > And the site.pp, file has > > > > -SNIP- > > import "modules" > > import "nodes" > > -SNIP- > > You don''t need either import statement. > > HTH, > > Nan > > -- > 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. > >-- 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.