Re: [Puppet Users] Seemingly random failures after 2.7.1 upgrade

2011-07-13 Thread Peter Meier
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


 Is using an empty class in init.pp problematic ?  All of these modules
 worked just fine before going from 2.6.8 to 2.7.1.


I have no idea, whether this is the problem. But why do you do:

 # manifests/init.pp
 import classes/*.pp

 class kvm {
 }


 # manifests/classes/host.pp
 class kvm::host {


?

Why not just have one file manifests/host.pp that contains the kvm::host
class? Everything else is not really necessary.

Puppet has quite a powerfull autoloading feature of classes and I think
it can be seen as a general best practice to have one class in a file in
its corresponding path on the filesystem.

With your current way you would need a global import kvm, so that the
init.pp class is actually parsed, so that the files in classes/ are
imported.
If this is not the case and the kvm::host class is not in a file that
can be found by the autoloader it won't find the class.

This becomes even trickier as other hosts can now interfere which
classes are available while compiling the next hosts classes, as an
import statement might only have been executed if Host A is compiled and
only this would then make these imported classes that Host B requires
available.

Actually, I remember that the autoloader should also look into init.pp
for the kvm::host class. But it's possible that something like that
might have changed in 2.7. But I don't know it.

Due to these two reasones (magic availability of classes, possible
changes in how classes become available in 2.7) I would generally
recommend to *not* use import statements and instead use puppet's
autoloading feature. They're rather hard to debug.

~pete
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4dOygACgkQbwltcAfKi39akACcCwslVzxzrTy3/H0r7kGyi4dB
M4gAn1LHtc/LGk7OtbVfDolhm5cXwm/p
=lWHm
-END PGP SIGNATURE-

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Seemingly random failures after 2.7.1 upgrade

2011-07-13 Thread Nigel Kersten
On Tue, Jul 12, 2011 at 11:29 PM, Peter Meier peter.me...@immerda.chwrote:


 Puppet has quite a powerfull autoloading feature of classes and I think
 it can be seen as a general best practice to have one class in a file in
 its corresponding path on the filesystem.


What he said. :)

Life really does become a lot simpler if you avoid 'import' everywhere you
can and just rely upon the class autoloader.

-- 
Nigel Kersten
Product Manager, Puppet Labs
Twitter: @nigelkersten

*Join us for **PuppetConf *http://www.bit.ly/puppetconfsig
September 22nd and 23rd in Portland, Oregon, USA.
*
*

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Seemingly random failures after 2.7.1 upgrade

2011-07-12 Thread treydock
I recently upgraded my Puppetmaster to 2.7.1, and am now having what
seem to be random puppet run failures on almost all my nodes.  All
nodes except the actual puppetmaster are running 2.6.8.  Right now I
will get alerted about a failure, then log into that system and do a
manual run, which will succeed.  Then maybe a few hours later another
run will fail, and nothing has changed on the puppetmaster.

So far two modules seem to be the most frequent failures.  Here's the
error from puppet-dashboard on a 2.6.8 client

err Could not retrieve catalog from remote server: Error 400 on
SERVER: Could not find class zabbix::agent for puppetclient0.domain
at /etc/puppet/manifests/nodes.pp:177 on node puppetclient0.domain
Puppet  2011-07-12 05:04 CDT
err Could not retrieve catalog; skipping runPuppet  
2011-07-12 05:04
CDT
notice  Using cached catalog

That module is a bit large to paste in here, but it can be viewed at
https://github.com/treydock/puppet-zabbix.

The other failures are on similarly designed modules and I've also
noticed that one very basic modules seem to be failing randomly on two
clients, both are 2.6.8


err Could not retrieve catalog from remote server: Error 400 on
SERVER: Could not find class kvm::host for puppetclient1.domain at /
etc/puppet/manifests/roles.pp:35 on node puppetclient1.domain   Puppet
2011-07-12 05:08 CDT
err Could not retrieve catalog; skipping runPuppet  
2011-07-12 05:08
CDT
notice  Using cached catalog

--

Here's the module...

# manifests/init.pp
import classes/*.pp

class kvm {
}


# manifests/classes/host.pp
class kvm::host {

package {'libvirt':
ensure = installed,
}

service {
'libvirtd':
enable  = true,
ensure  = running,
require = Package['libvirt'];
}

logrotate::file { 'libvirtd':
log = '/var/log/libvirt/qemu/*.log',
interval= 'weekly',
rotation= '52',
archive = 'true',
minsize = '100k',
options = [ 'missingok', 'notifempty', 'sharedscripts',
'dateext', 'copytruncate' ],
}

}


Is using an empty class in init.pp problematic ?  All of these modules
worked just fine before going from 2.6.8 to 2.7.1.


Thanks
- Trey

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.