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? -- Brian L. Troutwine -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
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. 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
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+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. >
On Mon, Aug 22, 2011 at 12:46 PM, Stefan Schulte < stefan.schulte@taunusstein.net> wrote:> 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. >Right.> 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 >On Linux systems that should be ''none'' in the second field there, as well as most BSD systems though it''s been a while. man 5 fstab and forward search for ''none''. 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 >Please elaborate.> 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 > >The mount point does matter, which is the problem. If the ''mount'' type were keyed on an alias this would be a non-problem but instead it''s by mount point which is, by definition, not unique.> -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+unsubscribe@googlegroups.com. > > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > >-- Brian L. Troutwine -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Mon, Aug 22, 2011 at 11:19 AM, jcbollinger <John.Bollinger@stjude.org>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. > >No joy, I''m afraid. To the best of my understanding from the source the ''mount'' type is keyed entirely on the mount point. I''ll take out a bug as time allows, but I''m not entirely sure how to phrase it. It''s rather less a bug than it is that a fundamental assumption of one of puppet''s core types does not hold.> > 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+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- Brian L. Troutwine -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Mon, Aug 22, 2011 at 12:53:58PM -0400, Brian Troutwine wrote:> On Mon, Aug 22, 2011 at 12:46 PM, Stefan Schulte < > stefan.schulte@taunusstein.net> wrote: > > > 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 > > > > On Linux systems that should be ''none'' in the second field there, as well as > most BSD systems though it''s been a while. man 5 fstab and forward search > for ''none''. > > 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 > > > > Please elaborate. >Whenever you have the wrong device for a mount in your fstab you end up with mounts in mounts. For me this would happens a lot for nfs mounts where some machines are configured with hostname:/share and others with hostname.domain.tld:/share If puppet identifies a mount with name AND device I will end up with two lines in fstab for the same share. Pretty ugly.> > 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 > > > > > The mount point does matter, which is the problem. If the ''mount'' type were > keyed on an alias this would be a non-problem but instead it''s by mount > point which is, by definition, not unique. >No I meant mount/swapon/swapoff probably doesnt care. So you may be able to do mount { ''swap1'': device => ''swap'', fstype => ''swap'', } mount { ''swap2'': device => ''swap'', fstype => ''swap'', } But as you already pointed out, according to the man page mountpoint should always be ''none'' so that is not an option. -Stefan
On Mon, Aug 22, 2011 at 1:12 PM, Stefan Schulte < stefan.schulte@taunusstein.net> wrote:> On Mon, Aug 22, 2011 at 12:53:58PM -0400, Brian Troutwine wrote: > > On Mon, Aug 22, 2011 at 12:46 PM, Stefan Schulte < > > stefan.schulte@taunusstein.net> wrote: > > > > > 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 > > > > > > > On Linux systems that should be ''none'' in the second field there, as well > as > > most BSD systems though it''s been a while. man 5 fstab and forward search > > for ''none''. > > > > 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 > > > > > > > Please elaborate. > > > > Whenever you have the wrong device for a mount in your fstab you end up > with mounts in mounts. For me this would happens a lot for nfs mounts where > some machines are configured with hostname:/share and others with > hostname.domain.tld:/share > > If puppet identifies a mount with name AND device I will end up with two > lines in fstab for the same share. Pretty ugly.Oh geez, to my mind that''s _really_ undesirable behavior. Bug worthy, really.> > > 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 > > > > > > > > The mount point does matter, which is the problem. If the ''mount'' type > were > > keyed on an alias this would be a non-problem but instead it''s by mount > > point which is, by definition, not unique. > > > > No I meant mount/swapon/swapoff probably doesnt care. So you may be able to > do > > mount { ''swap1'': > device => ''swap'', > fstype => ''swap'', > } > mount { ''swap2'': > device => ''swap'', > fstype => ''swap'', > } > > But as you already pointed out, according to the man page mountpoint should > always > be ''none'' so that is not an option. > > -Stefan >-- Brian L. Troutwine -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Aug 22, 11:46 am, Stefan Schulte <stefan.schu...@taunusstein.net> wrote:> On Mon, Aug 22, 2011 at 08:19:35AM -0700, jcbollinger wrote: > > > On Aug 21, 2:56 pm, Brian Troutwine <br...@troutwine.us> wrote:[...]> > > 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.Well it''s a question of the definition of "match", now isn''t it? Unix permits different file systems to be mounted on the same (logical) mount point, as the OP''s example demonstrates. Unix -- some flavors, at least -- also permit the same device to be mounted on multiple mount points. But it is not meaningful or useful to define the same device mounted more than once on the same mount point, so there *is* a unique key for fstab entries and mounted file systems. On a more abstract level, if it''s meaningful to the system to have two fstab entries with some particular properties in common, then Puppet''s resource model both can and should support that. That''s not to say that the current version of Puppet supports it -- I strongly suspect it doesn''t. But some future version certainly could and should, hence my recommendation to file a ticket. 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Aug 22, 12:12 pm, Stefan Schulte <stefan.schu...@taunusstein.net> wrote:> Whenever you have the wrong device for a mount in your fstab you end up > with mounts in mounts. For me this would happens a lot for nfs mounts where > some machines are configured with hostname:/share and others with > hostname.domain.tld:/share > > If puppet identifies a mount with name AND device I will end up with two > lines in fstab for the same share. Pretty ugly.Again, Puppet needs to model the application space. I grant, however, that there may be corners that are not cost-effective (in time and resources) to model. Multiple swap spaces are not one of them. Puppet could address this issue by being either smart or configurable about whether multiple fstab entries referring to the same mount point are allowed. "Configurable" would mean at least one new property on the resource. "Smart" might anything, but might involve, for example, allowing multiple mounts only on mount points that are not absolute. 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.