Clarification on mount type behaviour

61 views
Skip to first unread message

apgrif...@gmail.com

unread,
Mar 29, 2017, 7:36:01 AM3/29/17
to Puppet Users
Hi,

From my testing it seems that when managing mount resources puppet only compares the manifest against fstab and not mtab. For example if I have

mount { '/tmp':
  ensure  => mounted,
  options => 'noexec,nodev,nosuid',
}

And then do mount -o remount,exec /tmp

I would expect the next puppet run to correct this, but I'm not seeing this, only if I edit fstab is the resource updated. Is this expected behavior?

(Running 4.9).

Thanks,

Alan

jcbollinger

unread,
Mar 30, 2017, 8:57:43 AM3/30/17
to Puppet Users
It is the longtime behavior associated with the "parsed" provider for the Mount resource type (the only provider for that type included in the box).  The documentation does not explicitly say that mtab is ignored, but if you read carefully then you will find that the behavior is characterized in some places in terms of the "filesystem table" and in at least one place explicitly in terms of fstab.  Look in particular at the documentation for Mount.ensure.

Overall, then, the Mount resource type primarily manages entries in fstab, and only secondarily manages whether the designated filesystem is mounted.  But perhaps it doesn't have to be limited that way.  Expanding its scope to cover the options with which the filesystem is actually mounted seems like a reasonable feature request.  And if you don't want to wait, then very likely you can roll your own by writing and using an extension of the existing "parsed" provider that adds the behavior you want.


John

Stefan Schulte

unread,
Mar 30, 2017, 5:57:49 PM3/30/17
to puppet...@googlegroups.com
Hi

On 30.03.2017 14:57, jcbollinger wrote:

> mounted. But perhaps it doesn't have to be limited that way. Expanding
> its scope to cover the options with which the filesystem is actually
> mounted seems like a reasonable feature request. And if you don't want
> to wait, then very likely you can roll your own by writing and using an
> extension of the existing "parsed" provider that adds the behavior you want.
>
>
> John

actually there is an ancient one

https://projects.puppetlabs.com/issues/6309

that finally ended in a forge module

https://forge.puppet.com/puppetlabs/mount_providers

The problem is that if you describe the desired value (e.g. options =>
"ro"), what is the current value? The value in /etc/fstab or in
/proc/self/mounts?

The forge module solves this dilemma by introducing two separate types
(that can be abstracted again to one define) but since the original
intention was to merge this back into core and this never happened I am
not sure of the general quality of this module. When it was first
released (which is a while back now) it introduced issues that had been
solved in the original mount provider and have been reintroduced in the
module (e.g. https://projects.puppetlabs.com/issues/4914) so make sure
the module is usable first.

- Stefan
Reply all
Reply to author
Forward
0 new messages