On 4/28/2010 10:10 PM, Jesús M. Navarro wrote:
Hi, list:

I'm trying to add a Debian-based Xen Dom0 server to puppet management.

One of the files I want to consider is /boot/grub/menu.lst since it contains
some Xen-related options.

When managing it by hand I'd produce a skeleton for menu.lst and then I'd
execute update-grub, which would look for avaliable kernels and would add
related configs to the menu.lst contents.

My first idea came in the lines of (within a class):
        file {
                "/boot/grub/menu.lst":
                        mode   =>  "0644",
                        owner  =>  root,
                        group  =>  root,
                        notify =>  Exec["update-grub"],
                        source =>  "puppet:///s_virtualcluster/menu.lst";
        }
        exec { "update-grub":
                path        =>  "/usr/bin:/usr/sbin:/bin",
                refreshonly =>  true,
        }

But since update-grub changes /boot/grub/menu.lst itself, the menu.lst
template gets downloaded and update-grub triggered each time puppet runs.

Is there an ellegant manner to deal with it? (like downloading menu.lst to a
different path, and then run update-grub only if md5sum of the real menu.lst
has changed from previous puppet run or if the server version from menu.lst
has changed?

Puppet already provides for exactly this check. Add

   checksum => md5

to the file and it will only notify when the actual contents change.


Best Regards, David
--
dasz.at OG              Tel: +43 (0)664 2602670     Web: http://dasz.at
Klosterneuburg                                         UID: ATU64260999

       FB-Nr.: FN 309285 g          FB-Gericht: LG Korneuburg

--
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