Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'simp-autofs', '7.4.0'
Learn more about managing modules with a PuppetfileDocumentation
Table of Contents
Description
This is a module for managing fileystem automounting using autofs.
This is a SIMP module
This module is a component of the System Integrity Management Platform, a compliance-management framework built on Puppet.
If you find any issues, please submit them via JIRA.
This module is optimally designed for use within a larger SIMP ecosystem, but it can be used independently:
- When included within the SIMP ecosystem, security compliance settings will be managed from the Puppet server.
- If used independently, all SIMP-managed security subsystems are disabled by
default and must be explicitly opted into by administrators. See the
SIMP
simp_options
module for more detail.
Setup
What autofs affects
The autofs
module installs autofs packages, configures the autofs service,
and manages all autofs configuration files.
It does not manage NFS, but seamlessly interoperates with the
SIMP nfs
module, which does manage
NFS.
Setup Requirements
The only requirement is to include the autofs
module and its dependencies
in your modulepath.
Beginning with autofs
You can use the autofs
module to manage general autofs
configuration files,
as well as auto.master
entry files and map files.
Managing general configuration files
The autofs
module manages the following general configuration files:
/etc/autofs.conf
/etc/autofs/sysconfig/autofs
/etc/auto.master
/etc/autofs_ldap_auth.conf
To configure the first three files, simply include autofs
or one of this
module's defines in a node's manifest and then set the appropriate
configuration values from the autofs
class via Hieradata.
- The managed
/etc/auto.master
file only allows configuration of included directories with one or more+dir
directives. All other auto.master entries must reside in one or more*.autofs
files in one of the included directories.
To configure the third file:
-
Include
autofs
or one of this module's defines in a node's manifest. -
Set the
autofs::ldap
parameter totrue
in Hieradata, along with any of the other LDAP-related parameters in theautofs
class, as appropriate. This will ensure/etc/autofs.conf
is configured to load the appropriate LDAP authentication configuration file.- The
autofs::ldap_auth
class that manages that file is included in the node's manifest.
-
Configure the LDAP-authentication-specific parameters of the
autofs::ldap_auth
class in Heiradata.
Managing automount maps
You can configure the automount map configuration via the $autofs::maps
parameter, or by including autofs::map
, autofs::masterfile
, and/or
autofs::mapfile
defines in your node's manifest. By default these will
create auto.master entry files in /etc/auto.master.simp.d
and map files in
/etc/autofs.maps.simp.d
. Both directories are fully managed by the autofs
module. This means any files in those directories that are not managed by a
Puppet resource will be purged.
Usage
Basic Usage
Configuring auto.master entries and maps from hieradata
The autofs
class provides a simple mechanism to configure 'file' type maps
in hieradata. Via the $autofs::map
parameter, you can configure any number
of direct or indirect 'file' maps. For example,
autofs::maps:
# direct mount
data:
mount_point: "/-"
mappings:
# mappings is a single Hash for direct maps
key: "/net/data"
options: "-fstype=nfs,soft,nfsvers=4,ro"
location: "nfs.example.com:/exports/data"
# indirect mount with wildcard key and key substitution
home:
mount_point: "/home"
master_options: "strictexpire --strict"
mappings:
# mappings is an Array for indirect maps
- key: "*"
options: "-fstype=nfs,soft,nfsvers=4,rw"
location: "nfs.example.com:/exports/home/&"
# indirect mount with multiple, explicit keys
apps:
mount_point: "/net/apps"
mappings:
- key: "v1"
options: "-fstype=nfs,soft,nfsvers=4,ro"
location: "nfs.example.com:/exports/apps1"
- key: "v2"
options: "-fstype=nfs,soft,nfsvers=4,ro"
location: "nfs.example.com:/exports/apps2"
- key: "latest"
options: "-fstype=nfs,soft,nfsvers=4,ro"
location: "nfs.example.com:/exports/apps3"
This would create 3 auto.master entry files and 3 corresponding map files:
-
/etc/auto.master.simp.d/data.autofs
: Direct map auto.master entry that references the/etc/autofs.simp.maps.d/data.map
map file./- /etc/autofs.maps.simp.d/data.map
-
/etc/auto.master.simp.d/home.autofs
: Indirect map auto.master entry that references the/etc/autofs.simp.maps.d/home.map
map file./home /etc/autofs.maps.simp.d/home.map
-
/etc/auto.master.simp.d/auto.autofs
: Indirect map auto.master entry that references the/etc/autofs.simp.maps.d/apps.map
map file./net/apps /etc/autofs.maps.simp.d/apps.map
-
/etc/autofs.maps.simp.d/data.map
: Direct map./net/data -fstype=nfs,soft,nfsvers=4,ro nfs.example.com:/exports/data
-
/etc/autofs.maps.simp.d/home.map
: Indirect map with wildcard key.* -fstype=nfs,soft,nfsvers=4,rw nfs.example.com:/exports/home/&
-
/etc/autofs.maps.simp.d/auto.map
: Indirect map with multiple keys.v1 -fstype=nfs,soft,nfsvers=4,ro nfs.example.com:/exports/apps1 v2 -fstype=nfs,soft,nfsvers=4,ro nfs.example.com:/exports/apps2 latest -fstype=nfs,soft,nfsvers=4,ro nfs.example.com:/exports/apps3
Configuring auto.master entries
To configure just an auto.master entry file, use the autofs::masterfile
define. For example,
-
To create an autofs master entry file for a direct 'file' map
autofs::masterfile { 'data': mount_point => '/-', map => '/etc/autofs.maps.simp.d/data' }
-
To create an autofs master entry file for an indirect 'file' map
autofs::masterfile { 'home': mount_point => '/home', map => '/etc/autofs.maps.simp.d/home' }
-
To create an autofs master entry file for a 'program' map
autofs::masterfile { 'nfs4': mount_point => '/nfs4', map_type => 'program', map => '/usr/sbin/fedfs-map-nfs4', options => 'nobind' }
-
To create an autofs master entry file for a 'ldap' map with a pre-configured LDAP server
autofs::masterfile { 'home': mount_point => '/home', map_type => 'ldap', map => 'ou=auto.indirect,dc=example,dc=com' }
Configuring map files
To configure just a map file, use the autofs::mapfile
define. For
example,
-
To create an autofs map file for a direct map
autofs::mapfile {'data': mappings => { 'key' => '/net/data', 'options' => '-fstype=nfs,soft,nfsvers=4,ro', 'location' => '1.2.3.4:/exports/data' } }
-
To create an autofs map file for an indirect map with wildcard key
autofs::mapfile { 'home': mappings => [ { 'key' => '*', 'options' => '-fstype=nfs,soft,nfsvers=4,rw', 'location' => '1.2.3.4:/exports/home/&' } ] }
-
To create an autofs map file for an indirect map with mutiple keys
autofs::mapfile { 'apps': mappings => [ { 'key' => 'v1', 'options' => '-fstype=nfs,soft,nfsvers=4,rw', 'location' => '1.2.3.4:/exports/apps1' }, { 'key' => 'v2', 'options' => '-fstype=nfs,soft,nfsvers=4,rw', 'location' => '1.2.3.4:/exports/apps2' }, { 'key' => 'latest', 'options' => '-fstype=nfs,soft,nfsvers=4,rw', 'location' => '1.2.3.5:/exports/apps3' } ] }
Configuring auto.master entry + map file pairs
To configure an auto.master entry file and its corresponding map file, use the
autofs::map
define. For example,
-
To create an autofs master and map files for a direct map
autofs::map {'data': mount_point => '/-', mappings => { 'key' => '/net/data', 'options' => '-fstype=nfs,soft,nfsvers=4,ro', 'location' => '1.2.3.4:/exports/data' } }
-
To create an autofs master and map files for an indirect map with the wildcard key
autofs::map { 'home': mount_point => '/home', master_options => 'strictexpire', mappings => [ { 'key' => '*', 'options' => '-fstype=nfs,soft,nfsvers=4,rw', 'location' => '1.2.3.4:/exports/home/&' } ] }
-
To create an autofs master and map files for an indirect map with multiple keys
autofs::map { 'apps': mount_point => '/apps', mappings => [ { 'key' => 'v1', 'options' => '-fstype=nfs,soft,nfsvers=4,rw', 'location' => '1.2.3.4:/exports/apps1' }, { 'key' => 'v2', 'options' => '-fstype=nfs,soft,nfsvers=4,rw', 'location' => '1.2.3.4:/exports/apps2' }, { 'key' => 'latest', 'options' => '-fstype=nfs,soft,nfsvers=4,rw', 'location' => '1.2.3.5:/exports/apps3' } ] }
Reference
Please refer to the REFERENCE.md.
Limitations
-
This module does not support
amd
configuration.- The
am-utils
service has been removed from Red Hat Enterprise Linux 8, and the support tail foramd
configuration is unclear.
- The
-
This module has no direct support for creating hesiod-formatted map files.
- You can use a
file
resource to manage a hesiod-formatted map file. Just make sure all of your custom map files that contain a direct map notify theExec['autofs_reload']
resource.
- You can use a
-
This module does not manage program executables that may be referenced in an auto.master entry.
- You can use a
file
resource to manage a program executable.
- You can use a
SIMP Puppet modules are generally intended for use on Red Hat Enterprise Linux
and compatible distributions, such as CentOS. Please see the metadata.json
file
for the most up-to-date list of supported operating systems, Puppet versions,
and module dependencies.
Development
Please read our Contribution Guide.
Unit tests
Unit tests, written in rspec-puppet
can be run by calling:
bundle install
bundle exec rake spec
Acceptance tests
This module includes Beaker acceptance tests using the SIMP Beaker Helpers. By default the tests use Vagrant with VirtualBox as a back-end; Vagrant and VirtualBox must both be installed to run these tests without modification. To execute the tests run the following:
bundle install
bundle exec rake beaker:suites
Please refer to the SIMP Beaker Helpers documentation for more information.
Reference
Table of Contents
Classes
Public Classes
autofs
: Manage the installation and configuration ofautofs
and ensureautofs::service
: Manage autofs service
Private Classes
autofs::config
: Managesautofs
global configurationautofs::config::pki
: Controls all pki related articles for autofsautofs::install
: Manages installation of autofsautofs::ldap_auth
: Set up theautofs_ldap_auth.conf
file
Defined types
autofs::map
: Create an auto.master entry file and its corresponding map fileautofs::map::entry
: Add an entry to the map specified in$name
autofs::map::master
: Add a$name.autofs
master entry file to$autofs::master_conf_dir
autofs::mapfile
: Create an autofs map fileautofs::masterfile
: Create a$name.autofs
master entry file in$autofs::master_conf_dir
Data types
Autofs::Authtype
: Preferred authentication mechanismAutofs::Directmapping
: Single direct file system mapping that can be specified in an autofs map fileAutofs::Indirectmapping
: Single indirect file system mapping that can be specified in an autofs map fileAutofs::Logging
: automounter log levelAutofs::Mapspec
: Specification for parameters needed to create an autofs::mapAutofs::Maptype
: Map type for an auto.master entry
Classes
autofs
its service is running.
- See also
- autofs.conf(5)
Examples
Specify 'file' type maps in hieradata
---
autofs::maps:
# direct mount
data:
mount_point: "/-"
mappings:
# mappings is a single Hash for direct maps
key: "/net/data"
options: "-fstype=nfs,soft,nfsvers=4,ro"
location: "nfs.example.com:/exports/data"
# indirect mount with wildcard key and key substitution
home:
mount_point: "/home"
master_options: "strictexpire --strict"
mappings:
# mappings is an Array for indirect maps
- key: "*"
options: "-fstype=nfs,soft,nfsvers=4,rw"
location: "nfs.example.com:/exports/home/&"
# indirect mount with multiple, explicit keys
apps:
mount_point: "/net/apps"
mappings:
- key: "v1"
options: "-fstype=nfs,soft,nfsvers=4,ro"
location: "nfs.example.com:/exports/apps1"
- key: "v2"
options: "-fstype=nfs,soft,nfsvers=4,ro"
location: "nfs.example.com:/exports/apps2"
- key: "latest"
options: "-fstype=nfs,soft,nfsvers=4,ro"
location: "nfs.example.com:/exports/apps3"
Parameters
The following parameters are available in the autofs
class:
timeout
master_wait
negative_timeout
mount_verbose
mount_wait
umount_wait
browse_mode
mount_nfs_default_protocol
append_options
logging
force_standard_program_map_env
map_hash_table_size
use_hostname_for_mounts
disable_not_found_message
sss_master_map_wait
use_mount_request_log_id
ldap_uri
ldap_timeout
ldap_network_timeout
search_base
map_object_class
entry_object_class
map_attribute
entry_attribute
value_attribute
auth_conf_file
custom_autofs_conf_options
automount_use_misc_device
automount_options
master_conf_dir
master_include_dirs
maps_dir
maps
samba_package_ensure
autofs_package_ensure
ldap
pki
timeout
Data type: Integer
Default mount timeout in seconds
- 'timeout' parameter in the 'autofs' section of /etc/autofs.conf
Default value: 600
master_wait
Data type: Optional[Integer]
Default maximum time to wait in seconds for the master map to become available if it cannot be read at program start
- 'master_wait' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
negative_timeout
Data type: Optional[Integer]
Default timeout for caching failed key lookups
- 'negative_timeout' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
mount_verbose
Data type: Boolean
Use the verbose flag when spawning mount
- 'mount_verbose' parameter in the 'autofs' section of /etc/autofs.conf
Default value: false
mount_wait
Data type: Optional[Integer]
Default time to wait for a response from a spawned mount before sending it a SIGTERM
- 'mount_wait' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
umount_wait
Data type: Optional[Integer]
Default time to wait for a response from a spawned umount before sending it a SIGTERM
- 'umount_wait' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
browse_mode
Data type: Boolean
Whether maps are browsable
- 'browse_mode' parameter in the 'autofs' section of /etc/autofs.conf
Default value: false
mount_nfs_default_protocol
Data type: Integer[3,4]
Default protocol that mount.nfs uses when performing a mount
- 'mount_nfs_default_protocol' parameter in the 'autofs' section of /etc/autofs.conf
Default value: 4
append_options
Data type: Boolean
Whether global options are appended to map entry options
- 'append_options' parameter in the 'autofs' section of /etc/autofs.conf
Default value: true
logging
Data type: Autofs::Logging
Default log level
- 'logging' parameter in the 'autofs' section of /etc/autofs.conf
Default value: 'none'
force_standard_program_map_env
Data type: Boolean
Override the use of a prefix with standard environment variables when a program map is executed
- 'force_standard_program_map_env' parameter in the 'autofs' section of /etc/autofs.conf
Default value: false
map_hash_table_size
Data type: Optional[Integer]
Set the number of hash table slots
- Should be a power of 2 with a ratio roughly between 1:10 and 1:20 for each map
- 'map_hash_table_size' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
use_hostname_for_mounts
Data type: Boolean
NFS mounts where the host name resolves to more than one IP address are probed for availability and to establish the order in which mounts to them should be tried
- 'use_hostname_for_mounts' parameter in the 'autofs' section of /etc/autofs.conf
Default value: false
disable_not_found_message
Data type: Boolean
Turn off not found messages
- 'disable_not_found_message' parameter in the 'autofs' section of /etc/autofs.conf
Default value: false
sss_master_map_wait
Data type: Optional[Integer]
Time to wait and retry if sssd returns "no such entry" when starting up
- 'sss_master_map_wait' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
use_mount_request_log_id
Data type: Boolean
Whether to use a mount request log id so that log entries for specific mount requests can be easily identified in logs that have multiple concurrent requests
- 'use_mount_request_log_id' parameter in the 'autofs' section of /etc/autofs.conf
Default value: false
ldap_uri
Data type: Optional[Array[Simplib::Uri,1]]
An LDAP server URI
- Only applies if
$ldap
istrue
. - 'ldap_uri' parameter in the 'autofs' section of /etc/autofs.conf, which can be specified multiple times
Default value: undef
ldap_timeout
Data type: Optional[Integer]
Network response timeout value for the synchronous API calls
- Only applies if
$ldap
istrue
. - 'ldap_timeout' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
ldap_network_timeout
Data type: Optional[Integer]
Network response timeout
- Only applies if
$ldap
istrue
. - 'ldap_network_timeout' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
search_base
Data type: Optional[Array[String,1]]
Base dn
to use when searching for a map base dn
- Only applies if
$ldap
istrue
. - 'search_base' parameter in the 'autofs' section of /etc/autofs.conf, which can be specified multiple times
Default value: undef
map_object_class
Data type: Optional[String]
Map object class
- Only applies if
$ldap
istrue
. - 'map_object_class' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
entry_object_class
Data type: Optional[String]
Map entry object class
- Only applies if
$ldap
istrue
. - 'entry_object_class' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
map_attribute
Data type: Optional[String]
Attribute used to identify the name of the map to which this entry belongs
- Only applies if
$ldap
istrue
. - 'map_attribute' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
entry_attribute
Data type: Optional[String]
Attribute used to identify a map key
- Only applies if
$ldap
istrue
. - 'entry_attribute' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
value_attribute
Data type: Optional[String]
Attribute used to identify the value of the map entry
- Only applies if
$ldap
istrue
. - 'value_attribute' parameter in the 'autofs' section of /etc/autofs.conf
Default value: undef
auth_conf_file
Data type: Stdlib::Absolutepath
Location of the ldap authentication configuration file
- Only applies if
$ldap
istrue
. - 'auth_conf_file' parameter in the 'autofs' section of /etc/autofs.conf
Default value: '/etc/autofs_ldap_auth.conf'
custom_autofs_conf_options
Data type: Hash
Custom key/value pairs to be set in the 'autofs' section of /etc/autofs.conf
- Useful to add new configuration parameters before they are managed by this module
- No validation will be done to this configuration.
Default value: {}
automount_use_misc_device
Data type: Boolean
Whether to use autofs miscellanous device when the kernel supports it
- 'USE_MISC_DEVICE' environment variable in /etc/sysconfig/autofs
Default value: true
automount_options
Data type: Optional[String]
Options to append to the automount application at start time
- See automount(8) for details
- 'OPTIONS' environment variable in /etc/sysconfig/autofs
Default value: undef
master_conf_dir
Data type: Stdlib::Absolutepath
Directory for SIMP-managed auto.master configuration files
Default value: '/etc/auto.master.simp.d'
master_include_dirs
Data type: Array[Stdlib::Absolutepath]
Other directories of auto.master configuration files to include
- This module will not manage these directories or their contents.
Default value: [ '/etc/auto.master.d' ]
maps_dir
Data type: Stdlib::Absolutepath
Directory for SIMP-managed map files
Default value: '/etc/autofs.maps.simp.d'
maps
Data type: Hash[String,Autofs::Mapspec]
Specification of 'file' maps to be configured
- An autofs master entry file and map file will be created for each map specification.
Default value: {}
samba_package_ensure
Data type: String
The value to pass to the ensure
parameter of the samba-utils
package.
Defaults to simp_options::package_ensure
or installed
Default value: simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' })
autofs_package_ensure
Data type: String
The value to pass to the ensure
parameter of the autofs
package.
Defaults to simp_options::package_ensure
or installed
Default value: simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' })
ldap
Data type: Boolean
Enable LDAP lookups
- Further configuration may need to be made in the
autofs::ldap_auth
class
Default value: simplib::lookup('simp_options::ldap', { 'default_value' => false })
pki
Data type: Variant[Enum['simp'],Boolean]
- If 'simp', include SIMP's pki module and use pki::copy to manage application certs in /etc/pki/simp_apps/autofs/x509
- If true, do not include SIMP's pki module, but still use pki::copy to manage certs in /etc/pki/simp_apps/autofs/x509
- If false, do not include SIMP's pki module and do not use pki::copy
to manage certs. You will need to appropriately assign a subset of:
- app_pki_dir
- app_pki_key
- app_pki_cert
- app_pki_ca
- app_pki_ca_dir
Default value: simplib::lookup('simp_options::pki', { 'default_value' => false })
autofs::service
Manage autofs service
Defined types
autofs::map
Creates a pair of autofs::masterfile
and autofs::mapfile
resources for
$name
.
- The auto.master entry will have the implied 'map_type' of 'file', will
have the default 'map_format' of 'sun', and will be written to file in
$autofs::master_conf_dir
. - The corresponding map file will be in 'sun' format and be located in
$autofs::maps_dir
.
Examples
Create an autofs master and map files for a direct map
autofs::map {'data':
mount_point => '/-',
mappings => {
'key' => '/net/data',
'options' => '-fstype=nfs,soft,nfsvers=4,ro',
'location' => '1.2.3.4:/exports/data'
}
}
Create an autofs master and map files for an indirect map with wildcard key
autofs::map { 'home':
mount_point => '/home',
mappings => [
{
'key' => '*',
'options' => '-fstype=nfs,soft,nfsvers=4,rw',
'location' => '1.2.3.4:/exports/home/&'
}
]
}
Create an autofs master and map files for an indirect map with multiple keys
autofs::map { 'apps':
mount_point => '/apps',
mappings => [
{
'key' => 'v1',
'options' => '-fstype=nfs,soft,nfsvers=4,rw',
'location' => '1.2.3.4:/exports/apps1'
},
{
'key' => 'v2',
'options' => '-fstype=nfs,soft,nfsvers=4,rw',
'location' => '1.2.3.4:/exports/apps2'
},
{
'key' => 'latest',
'options' => '-fstype=nfs,soft,nfsvers=4,rw',
'location' => '1.2.3.5:/exports/apps3'
}
]
}
Parameters
The following parameters are available in the autofs::map
defined type:
name
Basename of the map
- auto.master entry filename will be
${autofs::master_conf_dir}/${name}.autofs
- Corresponding map file will be named
${autofs::maps_dir}/${name}.map
- If
$name
has any whitespace or '/' characters, those characters will be replaced with '__' in order to create safe filenames.
mount_point
Data type: Stdlib::Absolutepath
Base location for the autofs filesystem to be mounted
- Set to '/-' for a direct map
- Set to a fully-qualified path for an indirect map
- See auto.master(5) -> FORMAT -> mount-point
master_options
Data type: Optional[String]
Options for the mount
and/or automount
commands that are to be specified
in the auto.master entry file
- See auto.master(5) -> FORMAT -> options
Default value: undef
mappings
Data type: Variant[Autofs::Directmapping, Array[Autofs::Indirectmapping,1]]
Single direct mapping or one or more indirect mappings
- Each mapping specifies a key, a location, and any automounter and/or mount options.
autofs::map::entry
THIS IS DEPRECATED. Use autofs::mapfile
or autofs::map
instead.
The map file will be created as ${autofs::maps_dir}/$target.map
.
You will need to create an appropriate autofs::masterfile
entry for
this to be activated.
- See also
- autofs(5)
Parameters
The following parameters are available in the autofs::map::entry
defined type:
name
In this case, $name
is mapped to the key
entry as described in
autofs(5)
- The special wildcard entry
*
is specified by entering the name aswildcard-<anything_unique>
target
Data type: Optional[String]
The name (not the full path) of the map file under which you would like this entry placed
- Required unless
$content
is set
Default value: undef
location
Data type: Optional[String]
The location that should be mounted
- Required unless
$content
is set - This should be the full path on the remote server
- Example:
1.2.3.4:/my/files
- Example:
- See
autofs(5)
for details
Default value: undef
options
Data type: Optional[String]
The NFS options
that you would like to add to your map
Default value: undef
content
Data type: Optional[String]
Use this content, without validation, ignoring all other options
Default value: undef
autofs::map::master
THIS IS DEPRECATED. Use autofs::masterfile
or autofs::map
instead.
- See also
- auto.master(5)
Parameters
The following parameters are available in the autofs::map::master
defined type:
mount_point
Data type: Optional[Stdlib::Absolutepath]
See auto.master(5) -> FORMAT -> mount-point
- Required unless
$content
is set
Default value: undef
map_name
Data type: Optional[String]
See auto.master(5) -> FORMAT -> map
- Required unless
$content
is set - $map_type[file|program] => Absolute Path
- $map_type[yp|nisplus|hesiod] => String
- $map_type[ldap|ldaps] => LDAP DN
Default value: undef
map_type
Data type: Optional[Autofs::Maptype]
See auto.master(5) -> FORMAT -> map-type
Default value: undef
map_format
Data type: Optional[Enum['sun','hesiod']]
See auto.master(5) -> FORMAT -> format
Default value: undef
options
Data type: Optional[String]
See auto.master(5) -> FORMAT -> options
Default value: undef
content
Data type: Optional[String]
Ignore all other parameters and use this content without validation
Default value: undef
autofs::mapfile
You will need to create an corresponding auto.master entry file, e.g. using
autofs::masterfile
, for this to be activated. Alternatively, use
autofs::map
, which will create both the master entry file and its map file
for you.
- See also
- autofs(5)
Examples
Create an autofs map file for a direct map
autofs::mapfile {'data':
mappings => {
'key' => '/net/data',
'options' => '-fstype=nfs,soft,nfsvers=4,ro',
'location' => '1.2.3.4:/exports/data'
}
}
Create an autofs map file for an indirect map with wildcard key
autofs::mapfile { 'home':
mappings => [
{
'key' => '*',
'options' => '-fstype=nfs,soft,nfsvers=4,rw',
'location' => '1.2.3.4:/exports/home/&'
}
]
}
Create an autofs map file for an indirect map with mutiple keys
autofs::mapfile { 'apps':
mappings => [
{
'key' => 'v1',
'options' => '-fstype=nfs,soft,nfsvers=4,rw',
'location' => '1.2.3.4:/exports/apps1'
},
{
'key' => 'v2',
'options' => '-fstype=nfs,soft,nfsvers=4,rw',
'location' => '1.2.3.4:/exports/apps2'
},
{
'key' => 'latest',
'options' => '-fstype=nfs,soft,nfsvers=4,rw',
'location' => '1.2.3.5:/exports/apps3'
}
]
}
Parameters
The following parameters are available in the autofs::mapfile
defined type:
name
Base name of the map excluding the path and the .map
suffix
- If
$name
has any whitespace or '/' characters, those characters will be replaced with '__' in order to create a safe filename.
mappings
Data type: Variant[Autofs::Directmapping, Array[Autofs::Indirectmapping,1]]
Single direct mapping or one or more indirect mappings
- Each mapping specifies a key, a location, and any
automount
and/ormount
options. - Any change to a direct map will trigger a reload of the autofs service. This is not necessary for an indirect map.
maps_dir
Data type: Optional[Stdlib::Absolutepath]
When unset defaults to $autofs::maps_dir
Default value: undef
autofs::masterfile
This will only create the autofs master entry file.
-
If the map type is 'file' or unspecified, you will need to create the map file, e.g. using
autofs::mapfile
. Alternatively, useautofs::map
which will create both the master entry file and its map file. -
If the map type is 'program', you will need to ensure the specified executable is available and has the appropriate permissions.
-
See also
- auto.master(5)
Examples
Create an autofs master entry file for a direct file map
autofs::masterfile { 'data':
mount_point => '/-',
map => '/etc/autofs.maps.simp.d/data'
}
Create an autofs master entry file for an indirect file map
autofs::masterfile { 'home':
mount_point => '/home',
map => '/etc/autofs.maps.simp.d/home'
}
Create an autofs master entry file for a program map
autofs::masterfile { 'nfs4':
mount_point => '/nfs4',
map_type => 'program',
map => '/usr/sbin/fedfs-map-nfs4',
options => 'nobind'
}
Create an autofs master entry file for a ldap map with pre-configured LDAP server
autofs::masterfile { 'home':
mount_point => '/home',
map_type => 'ldap',
map => 'ou=auto.indirect,dc=example,dc=com'
}
Parameters
The following parameters are available in the autofs::masterfile
defined type:
name
Base name of the autofs master entry file excluding the path and the
.autofs
suffix
- If
$name
has any whitespace or '/' characters, those characters will be replaced with '__' in order to create a safe filename.
mount_point
Data type: Stdlib::Absolutepath
Base location for the autofs filesystem to be mounted
- Set to '/-' for direct maps
- Set to a fully-qualified path for indirect mounts
- See auto.master(5) -> FORMAT -> mount-point
map
Data type: String
Name of the map to use
-
See auto.master(5) -> FORMAT -> map
-
Format of this String must match $map_type:
- $map_type of file|program => Absolute Path
- $map_type of yp|nisplus|hesiod => String
- $map_type of ldap|ldaps => LDAP DN
map_type
Data type: Optional[Autofs::Maptype]
Type of map used for this mount point
- When unspecified, autofs auto-detects the type.
- See auto.master(5) -> FORMAT -> map-type
Default value: undef
map_format
Data type: Optional[Enum['sun','hesiod']]
Format of the map data
- When unspecified, autofs assumes this is 'sun'
- See auto.master(5) -> FORMAT -> format
Default value: undef
options
Data type: Optional[String]
Options for mount
and/or automount
- See auto.master(5) -> FORMAT -> options
Default value: undef
Data types
Autofs::Authtype
Preferred authentication mechanism
Alias of Enum['GSSAPI', 'LOGIN', 'PLAIN', 'ANONYMOUS', 'DIGEST-MD5', 'EXTERNAL']
Autofs::Directmapping
Single direct file system mapping that can be specified in an autofs map file
Examples
Direct map without options
{ 'key' => '/mnt/apps', location => 'server.example.com:/exports/apps' }
Direct map with options
{ 'key' => '/mnt/apps', options => 'nfsvers=4,ro', location => 'server.example.com:/exports/apps' }
Alias of
Struct[{
key => Stdlib::Absolutepath,
options => Optional[Pattern[/\A\S+\z/]], # non empty string
location => Pattern[/\S/] # contains at least 1 non-whitespace char
}]
Autofs::Indirectmapping
Single indirect file system mapping that can be specified in an autofs map file
Examples
Indirect map without options
{ 'key' => 'data', location => 'server.example.com:/exports/data' }
Indirect map with options
{ 'key' => '*', options => 'soft,rw', location => 'server.example.com:/exports/home/&' }
Alias of
Struct[{
key => Pattern[/\A[^\s\/]+\z/], # non empty string excluding /
options => Optional[Pattern[/\A\S+\z/]], # non empty string
location => Pattern[/\S/] # contains at least 1 non-whitespace char
}]
Autofs::Logging
automounter log level
Alias of Enum['none', 'verbose', 'debug']
Autofs::Mapspec
Specification for parameters needed to create an autofs::map
Alias of
Struct[{
mount_point => Stdlib::Absolutepath,
master_options => Optional[String],
mappings => Variant[Autofs::Directmapping, Array[Autofs::Indirectmapping,1]]
}]
Autofs::Maptype
Map type for an auto.master entry
Alias of Enum['file', 'program', 'yp', 'nisplus', 'hesiod', 'ldap', 'ldaps', 'multi']
- Wed Oct 11 2023 Steven Pritchard steve@sicura.us - 7.4.0
- [puppetsync] Updates for Puppet 8
- These updates may include the following:
- Update Gemfile
- Add support for Puppet 8
- Drop support for Puppet 6
- Update module dependencies
- These updates may include the following:
- Wed Aug 23 2023 Steven Pritchard steve@sicura.us - 7.3.0
- Add AlmaLinux 8 support
- Mon Jun 12 2023 Chris Tessmer chris.tessmer@onyxpoint.com - 7.2.0
- Add RockyLinux 8 support
- Mon Jun 14 2021 Chris Tessmer chris.tessmer@onyxpoint.com - 7.1.0
- Removed support for Puppet 5
- Ensured support for Puppet 7 in requirements and stdlib
- Tue Mar 10 2020 Liz Nemsick lnemsick.simp@gmail.com - 7.0.0-0
- Added support for EL8
- Dropped support for EL6
- Refactored the module. Notable feature/API changes:
- Updated autofs service configuration to use /etc/autofs.conf in addition to /etc/sysconfig/autofs.
- Updated autofs.master to load content from /etc/auto.master.simp.d/
and /etc/auto.master.d/ in lieu of specifying map entries directly.
- auto.master entries are now written to files in /etc/auto.master.simp.d, a directory fully managed by this module.
- /etc/auto.master.d is left unmanaged by Puppet.
- Added a autofs::map defined type that allows the user to specify all the parameters for a 'file' map in once place. This resource will generate the appropriate resources to create both the auto.master entry file and the map file.
- Added autofs::masterfile defined type to replace deprecated
autofs::master::map
- autofs::masterfile creates a auto.master entry file in $autofs::master_conf_dir
- Unlike autofs::map::master, autofs::masterfile does not have a $content parameter, because a user can simply use a file resource to specify a custom auto.master entry file.
- Added autofs::mapfile defined type to replace deprecated
autofs::master::entry
- autofs::mapfile creates a mapfile for a direct mapping or one or more indirect mappings
- Unlike autofs::master::entry, it does not have duplicate resource naming problems (wildcard or otherwise).
- autofs class changes
- Added the following new autofs service configuration parameters:
- $master_wait
- $mount_verbose
- $mount_nfs_default_protocol
- $force_standard_program_map_env
- $use_hostname_for_mounts
- $disable_not_found_message
- $sss_master_map_wait
- $use_mount_request_log_id
- $auth_conf_file
- $custom_autofs_conf_options
- Added $master_conf_dir and $master_include_dirs parameters to allow users to specify directories containing auto.master entry files.
- Added $maps_dir to specify the location of SIMP-managed maps and changed the directory name from /etc/autofs to /etc/autofs.maps.simp.d for clarity.
- Added $maps to allow users to specifie 'file' type maps in Hieradata.
- Each map specifies the contents of an autofs master entry file and its mapping file.
- Renamed $options to $automount_options for clarity.
- Renamed $use_misc_device to $automount_use_misc_device for clarity.
- Removed $autofs::master_map_name
- This parameter is not exposed in /etc/autofs.conf and does not look like it is intended to be changed.
- Changed permissions of /etc/auto.master and /etc/sysconfig/autofs to match those of the delivered RPM.
- Added the following new autofs service configuration parameters:
- autofs::ldap_auth class changes
- autofs::ldap_auth is now a private class to ensure the name of the configuration file created by this class matches the 'auth_conf_file' setting in /etc/autofs.conf.
- Added $encoded_secret optional parameter. This parameter takes precedence when both $secret and $encoded_secret parameters are specified
- autofs::map::master has been deprecated by autofs::map or autofs::masterfile. Its behavior has changed from writing a section of /etc/auto.master to writing an autofs master entry file in $autofs::master_conf_dir.
- autofs::map::entry has been deprecated by autofs::map or autofs::mapfile. Its behavior has changed from writing a file in /etc/autofs to writing a file in $autofs::maps_dir.
- Fri Aug 02 2019 Robert Vincent pillarsdotnet@gmail.com - 7.0.0-0
- Support puppetlabs/concat 6.x.
- Thu Jun 06 2019 Steven Pritchard steven.pritchard@onyxpoint.com - 6.2.0-0
- Add v2 compliance_markup data
- Drop Puppet 4 support
- Add Puppet 6 support
- Add puppetlabs-stdlib 6 support
- Thu Feb 14 2019 Liz Nemsick lnemsick.simp@gmail.com - 6.1.3-0
- Expanded the upper limit of the concat and stdlib Puppet module versions
- Fixed a URL in the README.md
- Thu Nov 01 2018 Jeanne Greulich jeanner.greulich@onyxpoint.com - 6.1.2-0
- Static asset updates for puppet 5
- Update badges in README.md
- Tue Sep 11 2018 Nicholas Markowski nicholas.markowski@onyxpoint.com - 6.1.2-0
- Updated $app_pki_external_source to accept any string. This matches the functionality of pki::copy.
- Sat Mar 17 2018 Trevor Vaughan tvaughan@onyxpoint.com - 6.1.2-0
- Updated to work with Puppet 5 and OEL
- Mon Feb 12 2018 Liz Nemsick lnemsick.simp@gmail.com - 6.1.1-0
- Update upperbound on puppetlabs/concat version to < 5.0.0
- Fix trivial string lint issue
- Thu Nov 02 2017 Nick Miller nick.miller@onyxpoint.com - 6.1.0-0
- Allowed for control of specific versions of the packages in this
module with two new parameters:
- samba_package_ensure
- autofs_package_ensure
- Support Puppet 5
- Fri Aug 18 2017 Liz Nemsick lnemsick.simp@gmail.com - 6.0.2-0
- Update concat version in metadata.json
- Thu Jul 06 2017 Liz Nemsick lnemsick.simp@gmail.com - 6.0.1-0
- Confine puppet version in metadata.json
- Tue Jan 10 2017 Nick Markowski nmarkowski@keywcorp.com - 6.0.0-0
- Updated pki scheme
- Application certs now managed in /etc/pki/simp_apps/autofs/x509
- Mon Jan 02 2017 Trevor Vaughan tvaughan@onyxpoint.com - 6.0.0-0
- Ripped out all NFS materials
- NFS can now work with the configuration of autofs but there should not have been a strong dependency the other way
- Thu Dec 08 2016 Nick Markowski nmarkowswki@keywcorp.com - 6.0.0-0
- Updated global catalysts
- Strong typed
- Changed empty string defaults to undef
- Thu Dec 02 2016 Nick Markowski nmarkowski@keywcorp.com - 5.0.1-0
- Removed pupmod-simp-sysctl in favor of augeas-sysctl
- Mon Nov 21 2016 Chris Tessmer chris.tessmer@onyxpoint.com - 5.0.0-0
- Updated to compliance_markup version 2
- Tue Oct 18 2016 Trevor Vaughan tvaughan@onyxpoint.com - 5.0.0-0
- Updated to use the version of 'simpcat' that does not conflict with 'puppetlabs/concat'.
- Tue Oct 11 2016 Trevor Vaughan tvaughan@onyxpoint.com - 4.1.3-0
- Fixed an issue where the filenames used by 'concat' could contain '/' which made them unfit for system use.
- Also added 'audit' options to the file resources that control the 'autofs' service restarts.
- Tue Aug 09 2016 Nick Markowski nmarkowski@keywcorp.com - 4.1.2-0
- Fixed dependency cycle between autofs and stunnel with an ugly exec.
- Mon Mar 14 2016 Trevor Vaughan tvaughan@onyxpoint.com - 4.1.1-0
- Fixed template variable reference typos
- Tue Mar 01 2016 Ralph Wright ralph.wright@onyxpoint.com - 4.1.0-8
- Added compliance function support
- Mon Nov 09 2015 Chris Tessmer chris.tessmer@onypoint.com - 4.1.0-7
- migration to simplib and simpcat (lib/ only)
- Fri Jan 16 2015 Trevor Vaughan tvaughan@onyxpoint.com - 4.1.0-6
- Changed puppet-server requirement to puppet
- Fri Sep 19 2014 Trevor Vaughan tvaughan@onyxpoint.com - 4.1.0-5
- Updated to be compatible with RHEL7
- Sun Jun 22 2014 Kendall Moore kmoore@keywcorp.com - 4.1.0-4
- Removed MD5 file checksums for FIPS compliance.
- Tue May 06 2014 Trevor Vaughan tvaughan@onyxpoint.com - 4.1.0-3
- If nfs is using stunnel, then have a restart of stunnel trigger a restart of autofs in an attempt to have consistency when transitioning into an stunnel setup.
- Mon Apr 21 2014 Trevor Vaughan tvaughan@onyxpoint.com - 4.1.0-2
- Updated ldap_bind_dn and ldap_bind_pw to use hiera settings instead.
- Thu Feb 27 2014 Kendall Moore kmoore@keywcorp.com - 4.1.0-1
- Added reasonable defaults for user and secret in ldap_auth.pp
- Mon Dec 16 2013 Trevor Vaughan tvaughan@onyxpoint.com - 4.1.0-0
- Updated the code to work with Puppet 3 and Hiera.
- Integrated the full Puppet spec test suite.
- Thu Oct 03 2013 Kendall Moore kmoore@keywcorp.com - 2.0.0-10
- Updated all erb templates to properly scope variables.
- Thu Jan 31 2013 Maintenance 2.0.0-9
- Created a Cucumber test that mounts a test folder in a different location to see if module is working properly.
- Thu Aug 02 2012 Maintenance 2.0.0-8
- Updated the autofs::map::entry to be able to handle entries with '/' in them.
- Wed Apr 11 2012 Maintenance 2.0.0-7
- Moved mit-tests to /usr/share/simp...
- Updated pp files to better meet Puppet's recommended style guide.
- Fri Mar 02 2012 Maintenance 2.0.0-6
- Improved test stubs.
- Mon Jan 30 2012 Maintenance 2.0.0-5
- Added test stubs.
- Mon Dec 26 2011 Maintenance 2.0.0-4
- Updated the spec file to not require a separate file list.
- Thu Oct 27 2011 Maintenance 2.0.0-3
- Now pull the name of the portmap service from an nfs class variable since it changes between RHEL5 and RHEL6.
- Thu Jul 07 2011 Maintenance 2.0.0-1
- Fixed wildcard key support. You can now specify one wildcard entry as 'wildcard' but all define calls must be unique, so you can specify other wildcard entries with 'wildcard-<some_unique_name>'
- Fri Apr 22 2011 Maintenance - 1.0-0
- Initial offering of an AutoFS module.
Dependencies
- puppetlabs/stdlib (>= 8.0.0 < 10.0.0)
- simp/simplib (>= 4.9.0 < 5.0.0)
pupmod-simp-autofs- A Puppet Module for managing AutoFS -- Per Section 105 of the Copyright Act of 1976, these works are not entitled to domestic copyright protection under US Federal law. The US Government retains the right to pursue copyright protections outside of the United States. The United States Government has unlimited rights in this software and all derivatives thereof, pursuant to the contracts under which it was developed and the License under which it falls. --- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.