Version information
This version is compatible with:
- Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.7.0 < 7.0.0
- CentOS,OracleLinux,RedHat,Scientific,Debian,Ubuntu,Fedora,Darwin,SLES,Solaris
Start using this module
Add this module to your Puppetfile:
mod 'puppetlabs-mount_core', '1.0.0'
Learn more about managing modules with a PuppetfileDocumentation
mount_core
Table of Contents
- Description
- Setup - The basics of getting started with mount_core
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
The mount_core module manages mounted filesystems and mount tables. The module has some limitations, and you may be better off using the mount_providers module, which can manage mountpoints and mounttab resources independently.
Setup
What mount_core affects
The module can mount and unmount filesystems, and manage mount tables such as /etc/fstab, /etc/vfstab, or /etc/filesystems depending on your operating system.
Mount resources can respond to refresh events, and can remount a filesystem in response to an event from another resource.
Mount resources automatically create relationships with directories that are either ancestors of the mounted directory or children. This way puppet will automatically create ancestor directories before the mount point, and will do that before managing directories and files within the mounted directory.
Beginning with mount_core
To mount the device /dev/foo
at /mnt/foo
as read-only:
mount { '/mnt/foo':
ensure => 'mounted',
device => '/dev/foo',
fstype => 'ext3',
options => 'ro',
}
Usage
For details on usage, please see the mount puppet docs.
Reference
Please see REFERENCE.md for the reference documentation.
This module is documented using Puppet Strings.
For a quick primer on how Strings works, please see this blog post or the README.md for Puppet Strings.
To generate documentation locally, run
bundle install
bundle exec puppet strings generate ./lib/**/*.rb
This command will create a browsable _index.html
file in the doc
directory. The references available here are all generated from YARD-style comments embedded in the code base. When any development happens on this module, the impacted documentation should also be updated.
Development
Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.
We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
For more information, see our module contribution guide.
Reference
Table of Contents
Resource types
mount
: Manages mounted filesystems, including putting mount information into the mount table. The actual behavior depends on the value of the 'ensur
Resource types
mount
Manages mounted filesystems, including putting mount information into the mount table. The actual behavior depends on the value of the 'ensure' parameter.
Refresh: mount
resources can respond to refresh events (via
notify
, subscribe
, or the ~>
arrow). If a mount
receives an event
from another resource and its ensure
attribute is set to mounted
,
Puppet will try to unmount then remount that filesystem.
Autorequires: If Puppet is managing any parents of a mount resource --- that is, other mount points higher up in the filesystem --- the child mount will autorequire them.
Autobefores: If Puppet is managing any child file paths of a mount point, the mount resource will autobefore them.
Properties
The following properties are available in the mount
type.
ensure
Valid values: defined, present, unmounted, absent, mounted
Aliases: "present"=>"defined"
Control what to do with this mount. Set this attribute to
unmounted
to make sure the filesystem is in the filesystem table
but not mounted (if the filesystem is currently mounted, it will be
unmounted). Set it to absent
to unmount (if necessary) and remove
the filesystem from the fstab. Set to mounted
to add it to the
fstab and mount it. Set to present
to add to fstab but not change
mount/unmount status.
device
The device providing the mount. This can be whatever device is supporting by the mount, including network devices or devices specified by UUID rather than device path, depending on the operating system.
blockdevice
The device to fsck. This is property is only valid on Solaris, and in most cases will default to the correct value.
fstype
The mount type. Valid values depend on the operating system. This is a required option.
options
A single string containing options for the mount, as they would appear in fstab on Linux. For many platforms this is a comma-delimited string. Consult the fstab(5) man page for system-specific details. AIX options other than dev, nodename, or vfs can be defined here. If specified, AIX options of account, boot, check, free, mount, size, type, vol, log, and quota must be ordered alphabetically at the end of the list.
pass
The pass in which the mount is checked.
atboot
Whether to mount the mount at boot. Not all platforms support this.
dump
Whether to dump the mount. Not all platform support this.
Valid values are 1
or 0
(or 2
on FreeBSD). Default is 0
.
target
The file in which to store the mount table. Only used by those providers that write to disk.
Parameters
The following parameters are available in the mount
type.
name
namevar
The mount path for the mount.
remounts
Valid values: true
, false
Whether the mount can be remounted mount -o remount
. If
this is false, then the filesystem will be unmounted and remounted
manually, which is prone to failure.
Types in this module release
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
1.0.0 - 2018-07-18
Summary
This is the initial release of the extracted mount module.