On Tue, Mar 22, 2011 at 09:19:16PM +0100, Thomas Bellman wrote:
> Nigel Kersten wrote:
> 
> > TL;DR The mount provider has used a mish-mash of checking fstab and
> > actual mount state to determine state. A possible solution we're
> > looking at is splitting into two types, one that manages /etc/fstab
> > (or /etc/filesystem on other OSes), and one that manages actual mount
> > state.
> 
> [Details elided]
> 
> Two separate types is the obviously correct way.  Just like we
> have two separate types for specifying whether a service should
> be started at boot and for whether it should be running right
> now.  And just like we have nine separate types for specifying
> file type, owner, group, mode, content and SElinux parameters.
> 
> ...
> 
> Hey wait, we don't!  We only have one service type and one file
> type, with multiple properties.  Maybe there is some good reason
> for having it like that.  Perhaps like not requiring users to
> repeat the same things (service name; file path; mount-point and
> device) for things that very, very often go together.
> 
> So, no, I think splitting the mount type into two types would be
> a bad choice.
> 
> Splitting the 'ensure' parameter of the mount type into two, on
> the other hand, I think is a very good idea.
> 
> The nice way to transition would be to have two entirely new
> parameters, let's provisionally call them 'mount_state' and
> 'fstab_state', and in 2.7 have the 'ensure' parameter translated
> into those two new parameters with a warning about that syntax
> being deprecated, and then in 2.8 remove the 'ensure' parameter
> entirely.  (I actually dislike the names I propose above; they
> are just examples for the sake of discussing the principle.)

I disagree. Lets say you define something like this

mount { '/mnt/foo':
  device      => '/dev/foo',
  options     => 'ro',
  mount_state => mounted
  fstab_state => present
}

and lets also say that options is 'ro' in fstab but someone mounted the
device 'rw'. What should puppet report now? Is the »options« property
insync now? If not, what is its current value? ro or rw? What if its the
other way around? Wrong entry in fstab but correctly mounted?

Yes you have to specify device etc two times. Yes I want '/dev/foo' in
fstab and yes surprisingly I also want to actually mount '/dev/foo'. But
that makes sense because you also have two is-states (current device in
fstab and current device that is mounted on /mnt/foo).

So splitting the mounttype can lead to better reports when puppet sync
mountpoint and entry in fstab seperatly. Because I'm lazy I'll propably
write a define (maybe I will call it mount) that will create two
resources for the two new types.
>       /Bellman
> 
-Stefan

Attachment: pgpXwsPL2Uhe1.pgp
Description: PGP signature

Reply via email to