On Mon, Aug 22, 2011 at 08:19:35AM -0700, jcbollinger wrote: > > > On Aug 21, 2:56 pm, Brian Troutwine <br...@troutwine.us> wrote: > > Hello, all. > > > > I have a box that I'd like to have striping swap spaces. I attempted: > > > > mount { 'swap': > > alias => 'swap0', > > atboot => true, > > device => '/dev/xvdo', > > ensure => 'mounted', > > options=> 'defaults', > > fstype => 'swap', > > } > > mount { 'swap': > > alias => 'swap1', > > atboot => true, > > device => '/dev/xvdp', > > ensure => 'mounted', > > options=> 'defaults', > > fstype => 'swap', > > } > > > > and > > > > mount { 'swap0': > > name => 'swap', > > atboot => true, > > device => '/dev/xvdo', > > ensure => 'mounted', > > options=> 'defaults', > > fstype => 'swap', > > } > > mount { 'swap1': > > name => 'swap', > > atboot => true, > > device => '/dev/xvdp', > > ensure => 'mounted', > > options=> 'defaults', > > fstype => 'swap', > > } > > > > to predictable result. Problem is that mount conflates the name of the > > resource with it's mount path; I'm defining the same thing two ways each > > time. I _could_ write out my own fstab as a file resource, but that somewhat > > defeats the purpose of even having a mount type. Am I missing something? Is > > it possible to have multiple swap spaces with puppet? > > > I'm guessing that this is not supported, but here's a long shot: try > altering your second variation to use the 'path' property instead of > 'name' (even though the docs say it's deprecated). Even if that > works, I recommend filing a ticket: I see no inherent reason why > Puppet shouldn't be able to handle this.
This wouldnt work because you have two lines in fstab that match each mount resource (one in sync, the other one is not (because device is wrong). And I dont see a way out of it. Let's say you have just one swap device and the following configuration mount { 'swap': fstype => 'swap', device => /dev/swap1, } and in fstab you have /dev/swap2 swap swap defaults 0 0 What should puppet do now? Correct: device is out of sync so change the device. Now let's say you have the same fstab but add another resource mount { 'swap2': name => 'swap', fstype => 'swap', device => '/dev/swap2', } What should happen now? The first mount resource still matches with the line in fstab so it will change the device. On the other hand the line in fstab also matches the second resource so device will be changed again. One "solution" is to identify a mount by mountpoint AND device but that has drawbacks too BUT, I guess the mountpoint really doesnt care for swap. At least I have the following line in fstab: /dev/mapper/swap none swap sw 0 0 -Stefan > > > John > > -- > 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. >
pgpSZhT5YVf3d.pgp
Description: PGP signature