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
- Puppet >= 5.5.8 < 7.0.0
- , , , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppet-autofs', '6.0.0'
Learn more about managing modules with a PuppetfileDocumentation
Autofs Puppet Module
Table of Contents
- Description - - What the module does and why it is useful
- Setup - The basics of getting started with Autofs
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc
- Development - Guide for contributing to the module
- Support - When you need help with this module
Description
The Autofs module is a Puppet module for managing the configuration of on-demand mounting and automatic unmounting of local and remote filesystems via autofs / automount. This is a global module designed to be used by any organization. It enables most details of Autofs configuration to be specified via the user's choice of Puppet manifest or external data.
Setup
The Module manages the following:
- Autofs package
- Autofs service
- Autofs master map (/etc/auto.master)
- Autofs map files (e.g. /etc/auto.home)
Requirements
Usage
The module provides one class:
include autofs
With all default parameter values, this installs, enables, and starts the autofs service, configuring it to rely on the default location for the master map. If desired, the required state of the autofs package and / or service can instead be specified explicitly via class parameters. For example,
To ensure the package is absent:
class { 'autofs':
package_ensure => 'absent',
}
To ensure the service is disabled and not running:
class { 'autofs':
service_ensure => 'stopped',
service_enable => false,
}
Master Map
The module provides two compatible, built-in mechanisms for managing the
content of the master map: by setting the mounts
parameter of the autofs
class, and by declaration of autofs::mount
resources. Using these is not
obligatory -- one could instead use a File
resource, for instance, but
using the built-in mechanisms automatically provides for the autofs service
to be notified of any changes to the master map.
Note well, however, that managing the master map via this module's built-in mechanisms is an all-or-nothing affair. If any autofs mount points are managed via either of those mechanisms, then only mount points managed via those mechanisms will appear in the master map.
example
The declaration
autofs::mount { 'home':
mount => '/home',
mapfile => '/etc/auto.home',
options => '--timeout=120'
}
, or the equivalent element of the value of class parameter
$autofs::mounts
, will result in the following entry in the master
map"
/home /etc/auto.home --timeout=120
The target map file, /etc/auto.home
, is not affected by this.
Alternatively, this can be expressed directly in the declaration of
class autofs
:
class { 'autofs':
mounts => {
'home' => {
'mount' => '/home',
'mapfile' => '/etc/auto.home',
'options' => '--timeout=120'
}
}
}
or in YAML form in external Hiera data:
lookup_options:
autofs::mounts:
merge: hash
autofs::mounts:
home:
mount: '/home'
mapfile: '/etc/auto.home'
options: '--timeout=120'
For more information about merge behavior see the doc for:
- Lookup docs
- Hiera 5 docs if using Puppet >= 4.9
Direct Map /-
argument
The autofs module supports Autofs direct maps naturally. For a direct map,
simply specify the mount
parameter as /-
, just as is used for the purpose
in the auto.master
file. When this option is exercised, Autofs requires
the keys in the corresponding map file to be absolute paths of mountpoint
directories; this module does not validate that constraint.
example
Define:
autofs::mount { 'foo':
mount => '/-',
mapfile => '/etc/auto.foo',
options => '--timeout=120',
}
Hiera:
autofs::mounts:
foo:
mount: '/-'
mapfile: '/etc/auto.foo'
options: '--timeout=120'
+dir:
drop-in directories
The autofs module supports the use of Autofs's +dir:
option (Autofs 5.0.5
or later) to record master map content in drop-in files in a specified
directory instead of directly int rhe master map. When a mount
's use_dir
parameter is true
(default is false
), the corresponding master map entry
is created as a separate file in the appropriate directory instead of being
written directly into the master map. The master map is still, however,
ensured to contain an appropriate +dir:
entry designating the chosen
drop-in directory.
example
Define:
autofs::mount { 'home':
mount => '/home',
mapfile => '/etc/auto.home',
options => '--timeout=120',
use_dir => true
}
Hiera:
autofs::mounts:
home:
mount: '/home'
mapfile: '/etc/auto.home'
options: '--timeout=120'
use_dir: true
Removing mount points
Unwanted mount points can be ensured absent
to force their removal. This
will remove them from the master map even if the master map is not otherwise
managed (and in that specific case, without otherwise managing that file),
either directly in the file or in the drop-in directory (but not both). If
at least one mount point is managed present
in the master map then it may
also be sufficient to simply omit unwanted mount points.
example
Define:
autofs::mount { 'home':
ensure => 'absent',
mount => '/home',
mapfile => '/etc/auto.home',
}
Hiera:
autofs::mounts:
home:
ensure: 'absent'
mount: '/home'
mapfile: '/etc/auto.home'
Map Files
The module also provides two compatible, built-in mechanisms for managing
Autofs map files: by setting the mapfiles
parameter of the autofs
class, and by declaration of autofs::mapfile
resources. As with entries
in the master map, using these is not obligatory. In fact, they are
applicable only to map files written in the default (sun) map format;
some other mechanism must be chosen if map files in some other format are
to be managed.
As with the master map, managing map files via this module's built-in mechanisms is an all-or-nothing affair. If a map file is managed via these mechanisms then only mappings declared via these mechanisms will be included.
Note that map file management is wholly independent of master map management. Just as managing mount points in the master map does not affect corresponding map files, managing map files does not affect the master map.
For example,
autofs::mapfile { 'home':
path => '/etc/auto.home',
mappings => [
{ 'key' => '*', 'options' => 'rw,soft,intr', 'fs' => 'server.example.com:/path/to/home/shares' }
]
}
The standard external-data representation again is associated with the module
via a parameter of class autofs
:
autofs::mapfiles:
home:
path: '/etc/auto.home'
mappings:
- key: '*'
options: 'rw,soft,intr'
fs: 'server.example.com:/path/to/home/shares'
Whichever form is used, the resulting mapping in file /etc/auto.home
is
* -rw,soft,intr server.example.com:/path/to/home/shares
Executable map files
By default, map files are marked as 0644
. If a map file must be executable,
you can set the execute
parameter to enforce 0755
.
autofs::mapfile { 'home':
path => '/etc/auto.data',
execute => true
}
Multiple mappings in the same file
Multiple mappings may be declared for the same map file, either in the same
autofs::mapfile
resource (or an entry in the $::autofs::mappings
class
parameter or corresponding external data), or in one or more separate
autofs::mapping
resources:
autofs::mapfile { '/mnt/data':
}
autofs::mapping { '/mnt/data_dataA':
mapfile => '/mnt/data',
key => 'dataA',
options => 'ro',
fs => 'remote.com:/exports/dataA'
}
autofs::mapping { '/mnt/data_dataB':
mapfile => '/mnt/data',
key => 'dataB',
options => 'rw,noexec',
fs => 'remote.com:/exports/dataB'
}
The resulting content of file /mnt/data
would be
dataA -ro remote.com:/exports/dataA
dataB -rw,noexec remote.com:/exports/dataB
Removing Entries
To remove entries from a managed mapfile
simply remove the element
from the mappings
array in your manifest or external data. If the
mapping is expressed via a separate autofs::mapping
declaration, then
either omit that resource or ensure it absent
:
Example:
autofs::mapping { 'data':
ensure => 'absent',
mapfile => '/etc/auto.data',
key => 'dataA'
fs => 'example.com:/exports/dataA'
}
Reference
Classes
Public Classes
autofs
: Main class. Contains or calls all other classes or defines.
Private Classes
autofs::package
: Handles autofs packages.autofs::service
: Handles the service.
Parameters
mounts
Optional.
Data type: Hash
A hash of options that describe Autofs mount points for which entries
should appear in the master map. Each entry is equivalent to the title and
a hash of the parameters of one autofs::mount
resource.
mapfiles
Optional.
Data type: Hash
A hash of options that describe Autofs map files that should be managed.
Each entry is equivalent to the title and a hash of the parameters of one
autofs::mapfile
resource.
package_name
Data type: String or Array[String]
The name of the Autofs package(s). System-appropriate values for a variety of target environments are included with the module, so this parameter does not usually need to be specified explicitly.
package_ensure
Data type: String
Determines the required state of the autofs package. Can be set to: installed
, absent
, lastest
, or a specific
version string.
Default: 'installed'
service_name
Data type: String
The name of the Autofs service, as appropriate for use with the target environment's tools. System-appropriate values for a variety of target environments are included with the module, so this parameter does not usually need to be specified explicitly.
service_ensure
Data type: Enum['running', 'stopped']
Determines required state of the autofs service.
Default: 'running'
service_enable
Data type: Boolean
Determines whether the autofs service should start at system boot.
Default: true
reload_command
Optional.
Data type: String
If specified, a command to execute in the target environment to reload Autofs configuration without restarting the service.
auto_master_map
Data type: String
The absolute path to the Autofs master map. The standard paths used on a variety of supported environments are included with the module, so this parameter does not usually need to be specified explicitly.
map_file_owner
Data type: String
The system user who should own the master map and any managed map files. May be expressed either as a name or as a uid (in string form). The module defaults to 'root' for most environments and provides alternative defaults for supported target environments that ordinarily differ in this regard, so it is rarely necessary to specify this parameter explicitly unless a non-standard value is desired.
map_file_group
Data type: String
The system group to which the master map and any managed map files should be assigned. May be expressed either as a name or as a gid (in string form). The module defaults to 'root' for most environments and provides alternative defaults for supported target environments that ordinarily differ in this regard, so it is rarely necessary to specify this parameter explicitly unless a non-standard value is desired.
Defines
Public Defines
autofs::mount
: Describes an entry in the master map.autofs::mapfile
: Describes a (sun-format) map file and, optionally, some or all of its contents.autofs::mapping
: Describes one (sun-format) filesystem mapping in a specific map file.
Parameters for autofs::mount
ensure
Data type: String
The desired state of the mount definition in the master map. If set to
absent
, the resulting master map will not contain a mountpoint definition
corresponding to this resource. Defaults to present
.
mount
Data type: Stblib::Absolutepath
The Autofs mountpoint described by this resource. When this parameter has the value /-
, this resource describes a direct
mount, and the keys in the corresponding map file must be absolute paths to mountpoint directories. Otherwise, this
resource describes an indirect map, and this parameter is a base path to the automounted directories
described by the corresponding map file. Defaults to the title
of this autofs::mount
.
mapfile
Data type: Stdlib::Absolutepath or Autofs::MapEntry
This parameter designates the automount map serving this mount. Autofs supports a variety of options
here, but most commonly this is either an absolute path to a map file or the special string -hosts
.
options
Optional.
Data type: String
This parameter provides Autofs and/or mount options to be specified for this mount point in the master map.
order
Data type: Integer
This parameter specifies the relative order of this mount point in the master map.
Default: 1
master
Data type: Stdlib::Absolutepath
This parameter specifies the path to the master map. It's system-dependent default value is usually the right choice.
Default: (system-dependent)
map_dir
Data type: Stdlib::Absolutepath
This parameter specifies the path to the Autofs master map drop-in directory
in which this mount's definition should reside. This may differ from mount
to mount. Applies only to autofs 5.0.5 or later, and only when the use_dir
parameter is set to true
.
Default: '/etc/auto.master.d'
use_dir
Data type: Boolean
This parameter specifies whether to manage this mount point via its own file in a drop-in directory, as opposed to recording it directly in the master map. Relevant only for autofs 5.0.5 or later.
Default: false
Parameters for autofs::mapfile
ensure
Data type: String
This parameter specifies the target state of this map file, either present
or absent
.
Default: 'present'
path
Data type: Stdlib::Absolutepath
The absolute path to the map file managed by this resource. e.g '/etc/auto.data'.
Default: the title
of this resource.
mappings
Data type: Array of Autofs::Fs_mapping
Each element corresponds to one (sun-format) mapping in the file, with a key, usually some mount options, and a specification of the filesystem(s) to mount. The filesystem specification format is extremely loose, accommodating not only the typical case of a single remote filesystem spec, but also the wide variety of Autofs-recognized alternatives such as shared mounts, multi-mounts, and replicated mounts.
Example:
[
{ 'key' => 'dataA', 'options' => 'rw,noexec', 'fs' => 'remote.net:/exports/dataA' }
]
Default: []
replace
Data type: Boolean
This parameter specifies whether this map file's contents should be managed
in the event that the file already exists at the start of the Puppet run.
It affects not only mappings specified directly in this resource, but also
any that are specified for this map file via separate autofs::mapping
resources.
Default: true
execute
Data type: Boolean
This parameter specifies whether this map file should be executable.
Default: false
Parameters for autofs::mapping
ensure
Data type: String
This parameter specifies whether the mapping it describes should be
present in the target map file, provided that that map file is managed
via an autofs::mapfile
resource or the equivalent data among the
parameters of class autofs
. Setting the value absent
is
substantially equivalent to altogether omitting any declaration of this
resource.
Default: 'present'
mapfile
The absolute path to the target map file hosting this mapping.
key
Data type: String matching /\A\S+\z/
The autofs key for this mapping.
fs
Data type: String matching /\S/
The filesystem specification for this mapping. The Sun map format permits a number of alternatives beyond simple, single mappings, and this module opts to allow wide latitude in filesystem specification instead of trying to codify all the alternatives.
Simple example: 'remote.net:/exports/data'
options
Optional.
Data type: String matching /A\S+\z/, or an Array of such Strings
Autofs and mount options specific to this mapping. If given as and array then elements are joined with commas (,) to form a single option string. Options should not be prefixed with a hyphen (-) unless that is part of the option itself. Options whose names do begin with a hyphen must not be first.
example: 'rw,noexec,nodev'
example: [ 'rw', 'noexec', 'nodev' ]
order
Data type: Integer
The relative order of this mapping in the target map file. Does not ordinarily need to be specified, because the map file order will be stable either way, and the order matters only if the map contains more than one mapping for the same key.
Default: 10
Limitations
Removals
Directly calling the autofs::package
and autofs::service
classes is disabled in 3.0.0.
These are now private classes.
The autofs::map
defined type is no longer documented or supported, and it will be removed
from a future version.
The direct
, executable
, mapcontents
, mapfile_manage
, and replace
parameters of
autofs::mount
are removed in 5.0.0, the first having already been ineffective in 4.3.0,
and the others no longer being relevant starting in 5.0.0.
Puppet platforms
Compatible with Puppet 4 or greater only. Puppet 4.6.0 or greater (including Puppet 5) will provide best results.
Operating Systems
- Supported
- Ubuntu
- 16.04
- 18.04
- CentOS/RHEL/Scientific/Oracle Linux
- 6.x
- 7.x
- SLES
- 11 Service Pack 4
- 12 Service Pack 1
- OpenSUSE 13.1
- Debian
- 7 "Wheezy"
- 8 "Jessie"
- Ubuntu
- Self Support - should work, support not provided by developer
- Solaris 10, 11
- AIX 7.1, 7.2
- Fedora 24, 25
- SLES 10
- CentOS/RHEL/Scientific/Oracle Linux 5.x
- Unsupported
- Windows (Autofs not available)
- Mac OS X
Development
Please see the CONTRIBUTING.md file for instructions regarding development environments and testing.
Authors
- Vox Pupuli: voxpupuli@groups.io
- David Hollinger: david.hollinger@moduletux.com
Reference
Table of Contents
Classes
Public Classes
autofs
: Manages the autofs facility, optionally including configuring mount points and maps.
Private Classes
autofs::package
: The autofs::package class installs the autofs package.autofs::service
: The autofs::service class configures the autofs service.
Defined types
autofs::map
: Defined type to generate autofs map entry configuration files.autofs::mapfile
: Defined type to manage overall autofs map filesautofs::mapping
: Defined type to manage a single filesystem mapping in a single map file.autofs::mount
: Defined type to manage mount point definitions in the Autofs master map.
Data types
Autofs::Fs_mapping
: A type representing a single filesystem mapping, relative to the context provided by an (unspecified) autofs map. "Single" refers to a singlAutofs::Mapentry
: This type matches a map specfication with map type and optional format, or the built-in -hosts map.Autofs::Options
: A type representing an autofs options list, represented either as a single non-empty string or an array of such strings
Classes
autofs
Autofs mount points and their corresponding maps can also be managed via separate autofs::mount, autofs::mapfile, and autofs::mapping resources.
To use this module, simply declare it in your manifest. The module now supports the ability to not only enable autofs, but to also disable or uninstall it completely.
- See also https://voxpupuli.org/puppet-autofs Home https://www.github.com/voxpupuli/puppet-autofs Github https://forge.puppet.com/puppet/autofs Puppet Forge
Examples
Declaring the autofs class
include autofs
Removing the package
class { 'autofs':
package_ensure => 'absent',
}
Disable the autofs service
class { 'autofs':
service_ensure => 'stopped',
service_enable => false,
}
using hiera with automatic lookup
---
autofs::mounts:
home:
mount: '/home'
mapfile: '/etc/auto.home'
options: '--timeout=120'
order: 01
autofs::mapfiles:
'/etc/auto.home':
'mappings':
- key: '*'
options: 'user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl'
fs: 'server.example.com:/path/to/home/shares'
Parameters
The following parameters are available in the autofs
class.
mounts
Data type: Hash[String, Hash]
the options with which to manage the autofs master map
Options:
- :mount
String
: The autofs mount point to be managed - :order
Integer
: The relative order in which the mount point's definition will appear in the master map - :mapfile
String
: Name of the autofs map file for this mount point - :options
String
: Mount options to be recorded for this mount point in the master map - :master
String
: Full path, including file name, to the master map in which to manage this mount point - :map_dir
String
: Full path, including file name, to the master map drop-in directory in which to manage this mount's definition. Relevant only when :use_dir is set to true - :use_dir
Boolean
: Whether to manage this mount via a file in the master map's drop-in directory instead of directly in the master map
mapfiles
Data type: Optional[Hash[String, Hash]]
options with which to manage map files.
Options:
- path:
String
: Full path, including file name, to a map file to manage. Defaults to the key with which this value is associated. - mappings:
Array
: an array of hashes defining specific, sun-format mappings that should appear in this map file. Each has a 'key', an option list in string or array form, and a filesystem specification as expected by the 'mount' command. - replace:
Boolean
: whether to modify the map file if it already exists
Default value: undef
maps
Data type: Optional[Hash[String, Hash]]
Deprecated. Use the mapfiles parameter instead.
Default value: undef
package_ensure
Data type: String
Determines the state of the package. Can be set to: installed, absent, lastest, or a specific version string.
package_name
Data type: Variant[String, Array[String]]
Determine the name of the package to install. Should be covered by hieradata.
package_source
Data type: Optional[String]
Determine the source of the package, required on certain platforms (AIX)
Default value: undef
service_ensure
Data type: Enum[ 'stopped', 'running' ]
Determines state of the service. Can be set to: running or stopped.
service_enable
Data type: Boolean
Determines if the service should start with the system boot. true will start the autofs service on boot. false will not start the autofs service on boot.
service_name
Data type: String
Determine the name of the service for cross platform compatibility
auto_master_map
Data type: String
Filename of the auto.master map for cross platform compatiblity
map_file_owner
Data type: String
owner of the automount map files for cross platform compatiblity
map_file_group
Data type: String
group of the automount map files for cross platform compatiblity
reload_command
Data type: Optional[String]
In lieu of a service reload capability in Puppet, exec this command to reload automount without restarting it.
Default value: undef
Defined types
autofs::map
Defined type to generate autofs map entry configuration files.
- See also https://voxpupuli.org/puppet-autofs Home https://voxpupuli.org/puppet-autofs/puppet_classes/autofs.html puppet_classes::autofs https://www.github.com/voxpupuli/puppet-autofs Github https://forge.puppet.com/puppet/autofs Puppet Forge
Examples
Using the autofs::map defined type to setup automount for nfs data directory.
autofs::map { 'data':
mapcontents => 'mydata -user,rw,soft,intr,rsize=32768,wsize=32768 nfs.example.org:/path/to/some/data',
mapfile => '/etc/auto.data',
order => '01',
}
Parameters
The following parameters are available in the autofs::map
defined type.
ensure
Data type: Enum['present', 'absent']
Whether to create the mapfile or not.
Default value: 'present'
mapcontents
Data type: Variant[Array, String]
The mount point options and parameters, Example: '* -user,rw,soft nfs.example.org:/path/to'
Default value: []
mapfile
Data type: Stdlib::Absolutepath
Name of the "auto." configuration file that will be generated.
Default value: $title
template
Data type: Enum['autofs/auto.map.erb', 'autofs/auto.map.exec.erb']
Template to use to generate the mapfile.
Default value: 'autofs/auto.map.erb'
mapmode
Data type: String
UNIX permissions to be added to the file.
Default value: '0644'
replace
Data type: Boolean
Whether or not to replace an existing mapfile of the same filename/path.
Default value: true
order
Data type: Integer
Order in which entries will appear in the autofs map file.
Default value: 1
autofs::mapfile
Defined type to manage overall autofs map files
- See also https://voxpupuli.org/puppet-autofs Home https://voxpupuli.org/puppet-autofs/puppet_classes/autofs.html puppet_classes::autofs https://www.github.com/voxpupuli/puppet-autofs Github https://forge.puppet.com/puppet/autofs Puppet Forge
Parameters
The following parameters are available in the autofs::mapfile
defined type.
ensure
Data type: Enum['present', 'absent']
Whether the mapfile should be present on the target system
Default value: 'present'
path
Data type: Stdlib::Absolutepath
An absolute path to the map file
Default value: $title
mappings
Data type: Array[Autofs::Fs_mapping]
an array of mappings to enroll in the file. Additional mappings can be specified for this mapfile via autofs::mapping resources
Default value: []
replace
Data type: Boolean
Whether to replace the contents of any an existing file at the specified path
Default value: true
execute
Data type: Boolean
Whether to make the mapfile executable or not
Default value: false
autofs::mapping
When ensured 'present', a autofs::mapfile resource managing the overall target map file must also be present in the catalog. This resource implements Autofs's 'sun' map format, which is the default.
It is not supported to declare multiple autofs::mappings with the same key, targetting the same map file, and ensured 'present'.
- See also https://voxpupuli.org/puppet-autofs Home https://voxpupuli.org/puppet-autofs/puppet_classes/autofs.html puppet_classes::autofs https://www.github.com/voxpupuli/puppet-autofs Github https://forge.puppet.com/puppet/autofs Puppet Forge
Examples
Options given as a string
autofs::mapping{ '/etc/auto.data_data':
mapfile => '/etc/auto.data',
key => 'data',
options => 'rw,sync,suid',
fs => 'storage_host.my.com:/path/to/data'
}
Options given as an array
autofs::mapping{ '/etc/auto.data_data':
mapfile => '/etc/auto.data',
key => 'data',
options => ['ro', 'noexec', 'nodev'],
fs => 'storage_host.my.com:/path/to/data'
}
No options
autofs::mapping{ '/etc/auto.data_data':
mapfile => '/etc/auto.data',
key => 'data',
fs => 'storage_host.my.com:/path/to/data'
}
Parameters
The following parameters are available in the autofs::mapping
defined type.
ensure
Data type: Enum['present', 'absent']
Whether the mapping should be present in the target mapfile; ensuring 'absent' is not meaningfully different from omitting the resource declaration altogether
Default value: 'present'
fs
Data type: Pattern[/\S/]
the remote filesystem to mount
key
Data type: Pattern[/\A\S+\z/]
the autofs key for this mappingr. For indirect maps it is the basename of the mountpoint directory for $fs (not to be confused with an autofs mount point, which is the parent directory). For direct maps it is the absolute path to the mountpoint directory.
mapfile
Data type: Stdlib::Absolutepath
the absolute path to the file containing the Autofs map to which this mapping belongs
options
Data type: Optional[Autofs::Options]
a comma-delimited mount options string or an array of individual mount options; neither individual options nor the overall option list should be specified with a leading hyphen (-); that is part of the map file format, not of the options themselves, and it is provided by this resource
Default value: undef
order
Data type: Integer
an integer describing the relative order of the mapping represented by this resource within the target map file (default 10). The order matters only if the same kay is enrolled more than once in the map, in which case only the first is effective.
Default value: 10
autofs::mount
autofs::mount { 'home': mount => '/home', mapfile => '/etc/auto.home', options => '--timeout=120', }
autofs::mount { 'smb': mount => '/smb', mapfile => 'program:/etc/auto.smb', options => '--timeout=120', }
- See also https://voxpupuli.org/puppet-autofs Home https://voxpupuli.org/puppet-autofs/puppet_classes/autofs.html puppet_classes::autofs https://www.github.com/voxpupuli/puppet-autofs Github https://forge.puppet.com/puppet/autofs Puppet Forge
Examples
Declaring an autofs mount point for automounting user home directories. (The
corresponding map file needs to be managed separately.)
Declaring a mount point with an executable map (to be managed
separately, if needed).
Remove an entry from the master map (the map file is unaffected)
autofs::mount { '/smb':
ensure => 'absent',
mapfile => 'program:/etc/auto.smb',
}
Parameters
The following parameters are available in the autofs::mount
defined type.
ensure
Data type: Enum['present', 'absent']
Whether a definition of this mount point should be present in the master map. (default: 'present')
Default value: 'present'
mount
Data type: Stdlib::Absolutepath
The absolute path of the Autofs mount point being managed. For a direct map, this should be '/-'. Otherwise, it designates the parent directory of the filesystem mount points managed by the map assigned to this Autofs mount point. (default: the title of this resource)
Default value: $title
mapfile
Data type: Variant[Stdlib::Absolutepath,Autofs::Mapentry]
a designation for the Autofs map associated with this mount point. Typically, this is an absolute path to a map file, whose base name conventionally begins with "auto.", but Autofs recognizes other alternatives, too, that can be specified via this parameter.
master
Data type: Stdlib::Absolutepath
Full path, including filename, to the autofs master map. Usually the correct master map will be chosen automatically, and you will not need to specify this.
Default value: $autofs::auto_master_map
map_dir
Data type: Stdlib::Absolutepath
Full path, including directory name, to the autofs master map's drop-in directory. Relevant only when $use_dir is true. (default: '/etc/auto.master.d').
Default value: '/etc/auto.master.d'
use_dir
Data type: Boolean
If true, autofs will manage this mount via a file in the master map's drop-in directory instead of directly in the master map. The master map will still be managed, however, to ensure at least that it enables the (correct) drop-in directory.
Default value: false
options
Data type: Optional[String]
Options to be specified for the autofs mount point within the master map.
Default value: undef
order
Data type: Integer
The relative order in which entries will appear in the master map. Irrelevant when $use_dir is true.
Default value: 1
Data types
Autofs::Fs_mapping
A type representing a single filesystem mapping, relative to the context provided by an (unspecified) autofs map. "Single" refers to a single key, but not necessarily a single mounted filesystem. Autofs has the concept of a multi-mount, where the map specifies multiple filesystems to mount via a single key, and the concept of shared mounts, where multiple keys reference subdirectories of a single (auto-)mounted file system. This type simply provides for a generic representation of all those alternatives via the 'fs' member.
Examples
Typical mapping for an indirect map
{ 'key' => 'data', 'options' => 'rw,sync', 'fs' => 'fs.host.com:/path/to/data' }
Mapping for a direct map, demonstrating also that the options may be omitted
{ 'key' => '/path/to/mnt', fs => 'remote.org:/exported/path' }
Demonstrating specifying an array of options
{ 'key' => 'other', 'options' => [ 'ro', 'noexec' ], 'fs' => 'external.net:/the/exported/fs' }
Alias of Struct[{ key => Pattern[/\A\S+\z/], options => Optional[Autofs::Options], fs => Pattern[/\S/] # contains at least one non-whitespace character }]
Autofs::Mapentry
This type matches a map specfication with map type and optional format, or the built-in -hosts map.
Examples
program:/etc/auto.smb
file:/etc/auto.file
file,sun:/etc/auto.file
yp:mnt.map
-hosts
Alias of Pattern[/\A([a-z]+(,[a-z]+)?:\S+|-hosts)\z/]
Autofs::Options
A type representing an autofs options list, represented either as a single non-empty string or an array of such strings
Alias of Variant[Pattern[/\A\S+\z/], Array[Pattern[/\A\S+\z/]]]
Changelog
All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module.
v6.0.0 (2020-04-07)
Breaking changes:
- modulesync 2.7.0 and drop puppet 4 #146 (bastelfreak)
Implemented enhancements:
- Enable auto-naming of the /etc/auto.\<mount> file. #105
- Manage autofs main configuration file #90
- autofs::mapfile can be configured to be executable. #143 (mdwheele)
- add Ubuntu 18.04 support #140 (bastelfreak)
Fixed bugs:
- parameter 'mappings' expects an Array value, got Struct #125
- Correctly notify the service #154 (ekohl)
- Allow puppetlabs/concat 6.x, puppetlabs/stdlib 6.x #147 (dhoppe)
- Fix mapping snippet (Puppet expects an Array) in README.md #145 (jaimegdpr)
Closed issues:
Merged pull requests:
- Remove duplicate CONTRIBUTING.md file #155 (dhoppe)
- Correct docs for puppet-strings syntax #153 (ekohl)
- Clean up acceptance spec helper #151 (ekohl)
- regenerate REFERENCE.md #150 (bastelfreak)
- drop EOL Ubuntu 14.04 #148 (bastelfreak)
- improve unit tests #144 (bastelfreak)
- fix apache-2 license detection #141 (bastelfreak)
- add initial REFERENCE.md #133 (bastelfreak)
v5.0.1 (2018-10-14)
Closed issues:
- Unknown variable: 'autofs::auto_master_map' in mount.pp #134
- autofs::mount mapfile_manage is still useful - need to add back #123
Merged pull requests:
- modulesync 2.1.0 and allow puppet 6.x #135 (bastelfreak)
- modulesync 1.9.6; allow puppetlabs/stdlib 5.x and puppetlabs/concat 5.x #130 (bastelfreak)
- drop EOL OSs; fix puppet version range #126 (bastelfreak)
- Rely on beaker-hostgenerator for docker nodesets #118 (ekohl)
v5.0.0 (2018-04-21)
Breaking changes:
- Wide refactoring of master map and map file management #119 (jcbollinger)
Implemented enhancements:
- Drop-in files created when $autofs::mount::use_dir is true should never be executable #109
- The mapfile banner should not be duplicated #103
Fixed bugs:
- The Autofs::Mapentry data type is incomplete #115
- Catalog compilation fails when mapcontents are given as a string #108
- Catalog compilation can fail when managing the same map file via multiple autofs::map resources #107
- Executable maps cannot be built from multiple pieces #104
- Made the Autofs::Mapentry type more permissive #116 (jcbollinger)
- Make all drop-in files non-executable #111 (jcbollinger)
- Fix handling for bare-string mapcontents #110 (jcbollinger)
Closed issues:
- Documentation uses wrong name for autofs::map::mapfile #101
Merged pull requests:
- Use docker sets in travis.yml #114 (ekohl)
- bump lower puppet version boundary to 4.10.10 #113 (bastelfreak)
- Correct and refresh README.md #102 (jcbollinger)
v4.3.0 (2018-03-05)
Closed issues:
- Add AIX support #96
Merged pull requests:
v4.2.1 (2018-02-28)
Implemented enhancements:
- Allow the special map name "-hosts" in Autofs::Mapentry #93
- Add ability to remove mounts and maps. #95 (dhollinger)
- Update code to allow for the special -hosts map #94 (dhollinger)
Fixed bugs:
- No option to remove an already defined autofs::mount #91
Closed issues:
- autofs mount #92
v4.2.0 (2017-12-09)
Merged pull requests:
- regenerate puppet-strings docs #87 (bastelfreak)
- Remove EOL operatingsystems #86 (ekohl)
v4.1.0 (2017-10-11)
Merged pull requests:
- Several fixes related to failing modulesync tests/support puppet5 #82 (dhollinger)
v4.0.0 (2017-09-13)
Breaking changes:
- BREAKING: refactor hiera data lookup #76 (dhollinger)
Implemented enhancements:
Fixed bugs:
- Solaris support with tests #78 (Nekototori)
v3.2.0 (2017-07-02)
Implemented enhancements:
- Add Puppet 5 compatibility #74 (dhollinger)
Closed issues:
- Not compatible with Puppet 5 #73
v3.1.0 (2017-06-24)
Implemented enhancements:
- Support map types in auto.master #67 (traylenator)
- Let
autofs::mount
mount option default to title. #66 (traylenator) - Specify default for order parameter on auto::mount #65 (traylenator)
- Multiple autofs::map instances per map. #62 (traylenator)
- New boolean mapfile_manage to manage mapfile #58 (traylenator)
- Introduce new type autofs::map #57 (traylenator)
Fixed bugs:
Closed issues:
- autofs_version fact throws exception on mac OS X #68
- mapcontents or mapcontent #63
- autofs::map has issues when order not set #59
Merged pull requests:
- bump minimal stdlib version to 4.13.1 #71 (bastelfreak)
- bump minimal puppet version to 4.7.0 #70 (bastelfreak)
- Fixes #63 autofs::map mapcontent parameter to mapcontents #64 (traylenator)
- Update map and mount defined types to address #59 #61 (dhollinger)
v3.0.2 (2017-05-11)
Implemented enhancements:
- Fixtures file now uses upstream git repos #53 (dhollinger)
Fixed bugs:
- Update the concat allowed version range to include 3.0.0 and 4.0.0 #54 (dhollinger)
Closed issues:
- autofs module forces use of puppetlabs/concat 2.x #48
- Incorrect puppet/stdlib dependency declaration #46
Merged pull requests:
- Fix rubocop errors #52 (dhollinger)
- Bump minimum required stdlib version to 4.13.0 #47 (alexjfisher)
v3.0.1 (2017-04-10)
Fixed bugs:
Closed issues:
- puppet-autofs #39
v3.0.0 (2017-04-06)
Breaking changes:
- Clean up data types #36
- Update data types and docs #37 (dhollinger)
- Remove unused mounts class #35 (dhollinger)
- Make package and service private #34 (dhollinger)
Implemented enhancements:
- Autofs version fact #26
- Make package and service classes private #24
- Remove autofs::mounts class #22
- Add parameters for managing the package and service state #21
Closed issues:
- Point Forge to the Module Documentation site #25
Merged pull requests:
- Add with_all_deps method to compile test #32 (dhollinger)
- [blacksmith] Bump version to 2.1.2-rc0 #29 (dhollinger)
- Add new fact for tracking autofs version #33 (dhollinger)
- Add parameters for configuring package and service #31 (dhollinger)
v2.1.1 (2017-03-10)
Fixed bugs:
- Instructions for managing autofs service appear to be incorrect #19
Closed issues:
- Migrate autofs module to Vox Pupuli #1
Merged pull requests:
- Fix CHANGELOG release tag name for v2.1.1 #27 (dhollinger)
- Remove invalid documentation #20 (dhollinger)
- update project information #17 (benkevan)
- General cleanup and corrections #15 (dhollinger)
v2.1.0 (2017-01-14)
Implemented enhancements:
- Cleanup call to autofs::mount #9 (dhollinger)
Fixed bugs:
mount
should not default to an empty array. #5
Merged pull requests:
- Updates puppet-strings docs #10 (dhollinger)
- migrate beaker tasks to ruby240/trusty env #8 (bastelfreak)
- Update documentation #7 (dhollinger)
v2.0.1 (2017-01-06)
Merged pull requests:
- Migration prep #3 (dhollinger)
v2.0.0 (2016-12-30)
v1.4.5 (2016-12-20)
v1.4.4 (2016-11-07)
v1.4.3 (2016-10-20)
v1.4.2 (2016-07-22)
v1.4.1 (2016-07-22)
v1.4.0 (2016-06-28)
v1.3.2 (2016-06-27)
v1.3.1 (2016-06-04)
v1.3.0 (2016-04-09)
v1.2.0 (2016-02-26)
v1.1.8 (2016-01-21)
v1.1.7 (2015-08-13)
v1.1.4 (2015-07-24)
v1.1.3 (2015-07-20)
v1.1.2 (2015-06-19)
v1.1.1 (2014-12-28)
v1.1.0 (2014-12-28)
v1.0.4 (2014-12-23)
v1.0.2 (2014-12-23)
v1.0.1 (2014-12-23)
v1.0.0 (2014-12-23)
v0.9.1 (2014-12-23)
v0.9.0 (2014-12-22)
v0.6.0 (2014-12-19)
v0.2.1 (2014-12-12)
v0.2.0 (2014-12-11)
v0.1.0 (2014-08-29)
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/concat (>= 4.1.0 < 7.0.0)
- puppetlabs/stdlib (>= 4.25.0 < 7.0.0)
Copyright (C) 2014 David Hollinger III Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS