Mike Renfro
2007-Jul-30 21:03 UTC
Module question: resources evaluated once or repeatedly?
I''ve been working up my first puppet module, one that will make Amanda configurations consistently. In general, I''d like the following to happen: - Each Amanda server should make sure all its holding disks are configured properly; this should only happen once per server, per puppetd run. Definitely not on a per-configuration basis. - Each Amanda server should keep its configurations (/etc/amanda/foo, /etc/amanda/foo/amanda.conf, /var/lib/amanda/foo, etc.) up to date. There will almost always be multiple configurations per Amanda server. Here''s what I''ve got now, excerpted down to the examples of each item: # modules/amandaconfig/init.pp # Create a new Amanda configuration set. file { "/opt/amanda": ensure => directory, owner => root, group => root, mode => 0755; } define amandaconfig ( $confdir = "/etc/amanda", $logdir = "/var/log/amanda", $libdir = "/var/lib/amanda", $user = "backup", $group = "backup", $dumpcycle = 1, $tapecycle = 2, $runtapes = 1, $labelstr = "LABEL" ) { file { "$confdir/$name": ensure => directory, owner => $user, group => $group, mode => 0770; "$confdir/$name/amanda.conf": content => template("amandaconfig/amanda.conf.erb"), ensure => present, owner => root, group => root, mode => 0755; } and in site.pp: node ch208r { include cae-host import "amandaconfig" amandaconfig { "holding": labelstr => "HOLDING", dumpcycle => 1, tapecycle => 2, runtapes => 1; "daily": labelstr => "DAILY", dumpcycle => 35, tapecycle => 10, runtapes => 1; "archival": labelstr => "ARCH[2-9]", dumpcycle => 0, tapecycle => 1000, runtapes => 4; } } Why do I get syslog warnings from other systems about Amanda configurations? Systems that aren''t even supposed to have Amanda installed: Jul 30 12:05:06 ch226-23 puppetd[2535]: (//File[/etc/amanda/daily/disklist.systems]/ensure) change from absent to file failed: Could not set file on ensure: No such file or directory - /etc/amanda/daily/disklist.systems.puppettmp at /etc/puppet/modules/amandaconfig/manifests/init.pp:33 Jul 30 12:06:05 ch226-22 puppetd[2570]: (//File[/usr/local/sbin/mkdisklist.archival]/source) replacing from source puppet:///amandaconfig/mkdisklist.archival with contents {md5}4eb027751e0987d3a4fbdfd466aa5d05 I''m currently attempting to move the once-per-system resources into the amandaconfig definition, but that''s causing other errors, I assume because puppet sees me specifying /opt/amanda repeatedly. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
Luke Kanies
2007-Jul-30 21:57 UTC
Re: Module question: resources evaluated once or repeatedly?
On Jul 30, 2007, at 4:03 PM, Mike Renfro wrote:> Why do I get syslog warnings from other systems about Amanda > configurations? Systems that aren''t even supposed to have Amanda > installed:Make sure that all of your amanda-related code is in a class named something like ''amanda'', then include this class on the hosts you want Amanda deployed to. -- If you can''t be a good example, then you''ll just have to be a horrible warning. -- Catherine Aird --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com