Hello all,

I've been using puppet for a while now and have an issue I've not
seen clearly answered.  One of the issues I want to address in puppet
is to manage LVM, the volume groups and logical volumes on a series
of servers.

Starting from a small base configuration I would like to configure the
logical volumes on the server.

However this doesn't seem to be a thing that puppet knows about directly.
My first thought is to create some custom facts which store the volume
group names and within each volume group the logical volumes. This is
not ideally stored as a couple of scalar values.

So how should I store this? Facter would seem to be the best thing to
adjust adding some custom facts but from what I can see all facter facts
are single scalar values.

So am I approaching the problem incorrectly? My initial thought is
that I'd like to populate some sort of variable volume_group_info as a
hash of hashes, the first hash being indexed on the volume group names
and the second on the logical volume group names in each volume group.

Still being new to ruby I'm trying to work out how to do this straight
in ruby but I'm sure this can be done, and if so my question would by
how to translate this into puppet code.

I'm initally looking at doing something like:

-- snip --
vol_groups = Hash.new

puts vol_groups.to_s

if FileTest.exists?("/usr/sbin/lvs")
        %x{/usr/sbin/lvs --noheadings 2>/dev/null}.split("\n").each do |line|
                if line =~ /\s+(\S+)\s+(\S+)/
                        puts "match vg: " + $2 + ", lv: " + $1
                        lvname = $1
                        vgname = $2

                        # now fill lvname into vol_groups by vgname...
                end
        end
end
-- snip --

Can anyone comment on this idea?

Simon

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to