Version information
This version is compatible with:
- Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.7.0 < 5.0.0
- , , , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppet-autofs', '3.1.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 automount network file system. This is a global module designed to be used by any organization. This module assumes the use of Hiera to set variables and serve up configuration files.
Setup
The Module manages the following:
- Autofs package
- Autofs service
- Autofs Configuration File (/etc/auto.master)
- Autofs Map Files (i.e. /etc/auto.home)
Requirements
Usage
The module includes a single class:
include autofs
By default this installs and starts the autofs service with the module's default master file.
You can also manage the state of the autofs package or service.
By default the module will install the autofs package and start/enable the autofs service. You can configure this by using the parameters defined in the main init class.
For example, to ensure the package is absent:
class { 'autofs':
package_ensure => 'absent',
}
To ensure that a service is disabled and not running:
class { 'autofs':
service_ensure => 'stopped',
service_enable => false,
}
Map Files
To setup the Autofs Map Files, there is a defined type that can be used:
autofs::mount { 'home':
mount => '/home',
mapfile => '/etc/auto.home',
mapcontents => ['* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares'],
options => '--timeout=120',
order => 01
}
This will generate content in both the auto.master file and a new auto.home map file:
auto.master
/home /etc/auto.home --timeout=120
auto.home
* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares
The defined type requires all parameters, except direct and execute, to build the autofs config. The direct and execute parameters allow for the creation of indirect mounts, see the Parameters section for more information on the defaults for direct and execute.
In hiera, there's a autofs::mounts
class you can configure, for example:
autofs::mounts:
home:
mount: '/home'
mapfile: '/etc/auto.home'
mapcontents:
- '* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares'
options: '--timeout=120'
order: 01
Direct Map /-
arugment
The autofs module also supports the use of the built in autofs /-
argument used with Direct Maps.
Examples:
Define:
autofs::mount { 'foo':
mount => '/-',
mapfile => '/etc/auto.foo',
mapcontents => ['/foo -o options /bar'],
options => '--timeout=120',
order => 01
}
Hiera:
autofs::mounts:
foo:
mount: '/-'
mapfile: '/etc/auto.foo'
mapcontents:
- '/foo -o options /bar'
options: '--timeout=120'
order: 01
Autofs +dir:
options
The autofs module now supports the use of the +dir:
option in the auto.master.
This option is 100% functional, but does require some work to simplify it.
Usage
Define:
autofs::mount { 'home':
mount => '/home',
mapfile => '/etc/auto.home',
mapcontents => ['* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares'],
options => '--timeout=120',
order => 01,
use_dir => true
}
Hiera:
autofs::mounts:
home:
mount: '/home'
mapfile: '/etc/auto.home'
mapcontents:
- '* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares'
options: '--timeout=120'
order: 01
use_dir: true
Map Entries
In addition to adding map entries via the mapcontents
parameter to autofs::mount the
autofs::map` type can also be used.
Usage
Define:
autofs::map{'data':
map => '/etc/auto.data',
mapcontents => 'data -user,rw,soft server.example.com:/path/to/data,
}
Hiera:
autofs::maps:
data:
map: '/etc/auto.data'
mapcontent: 'data -user,rw server.example.com:/path/to/data'
It is assumed that the map file itself has already been defined with
and autofs::mount
first.
autofs::mount{'auto.data':
mapfile => '/etc/auto.data',
mount => '/big',
}
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 will build the configuration. This hash is passed to the Defined type.
Each hash key is the equivalent to a parameter in the autofs::mount
defined type.
Default: undef
package_ensure
Data type: String
Determines the state of the package. Can be set to: installed, absent, lastest, or a specific version string.
Default: 'installed'
service_ensure
Data type: Enum['running', 'stopped']
Determines state of the service.
Default: 'running'
service_enable
Data type: Boolean
Determines if the service should start with the system boot.
Default: true
Defines
Public Defines
- autofs::mount: Builds the autofs configuration.
- autofs::map: Builds map entires for autofs configuration.
Parameters for autofs::mount
mount_name
Data type: String
This is a logical, descriptive name for what what autofs will be
mounting. This is represented by the home:
and tmp:
entries above.
mount
Data type: Stblib::Absolutepath
This Mapping describes where autofs will be mounting to. This map
entry is referenced by concat as part of the generation of the /etc/auto.master
file. Defaults to the title
of the autofs::mount
mapfile
Data type: Stdlib::Absolutepath or Autofs::MapEntry
This Mapping describes the name and path of the autofs map file.
This mapping is used in the auto.master generation, as well as generating the map
file from the auto.map.erb template. This parameter is no longer required.
When anything other than a simple file path is used mapfile_manage
must be false.
mapfile_manage
Data type: Boolean
If true the the mapfile file will be created and maintained. Defaults to true. Set this to false when the map file is maintained some other way, e.g auto.smb from the autofs package.
mapcontents
Data type: Array
This Mapping describes the folders that will be mounted, the mount options, and the path to the remote or local share to be mounted. Used in mapfile generation.
Default: []
options
Optional.
Data type: String
This Mapping describes the auto.master options to use (if any) when mounting the automounts.
Default: ''
order
Data type: Integer
This Mapping describes where in the auto.master file the entry will be placed. Order CANNOT be duplicated.
Default: undef
master
Data type: Stdlib::Absolutepath
This Parameter sets the path to the auto.master file.
Default: '/etc/auto.master'
map_dir
Data type: Stdlib::Absolutepath
This Parameter sets the path to the Autofs configuration directory for map files. Applies only to autofs 5.0.5 or later.
Default: '/etc/auto.master.d'
use_dir
Data type: Boolean
This Parameter tells the module if it is going to use $map_dir.
Default: false
direct
Data type: Boolean
Enable or disable indirect maps.
Default: true
execute
Data type: Boolean
Set mapfile to be executable.
Default: false
replace
Data type: Boolean
Whether or not to replace the mapfile if it already exists.
Default: true
Parameters for autofs::map
mapfile
Data type: Stdlib::Absolutepath
mapfile file to add entry to. e.g '/etc/auto.data'.
mapcontent
Data type: String
This Mapping describes a folder that will be mounted, the mount options, and the path to the remote or local share to be mounted. Used in mapfile generation. e.g. 'data -rw nfs.example.org:/data/big
Limitations
Removals
Directly calling the autofs::package
and autofs::service
classes is disabled in 3.0.0.
These are now private classes.
Puppet platforms
Compatible with Puppet 4 only. Puppet 4.6.0 will provide best results.
Operating Systems
- Supported
- Ubuntu
- 14.04
- 16.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
- Fedora 24, 25
- SLES 10
- CentOS/RHEL/Scientific/Oracle Linux 5.x
- Unsupported
- Windows (Autofs not available)
- Mac OS X (Autofs Not Available)
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
Change log
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 impact the functionality of the module.
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:
- Release 3.0.2 #55 (dhollinger)
- Fix rubocop errors #52 (dhollinger)
- modulesync 0.21.2 #51 (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
Merged pull requests:
- Release 3.0.1 #41 (dhollinger)
v3.0.0 (2017-04-06)
Implemented enhancements:
- Clean up data types #36
- 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)
- Prepare for 3.0.0 release #38 (dhollinger)
- BREAKING Update data types and docs #37 (dhollinger)
- BREAKING Remove unused mounts class #35 (dhollinger)
- BREAKING Make package and service private #34 (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)
- Prepare for 2.1.1 release #23 (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:
- Prepare for 2.1.0 release #12 (dhollinger)
- Updates puppet-strings docs #10 (dhollinger)
- migrate beaker tasks to ruby240/trusty env #8 (bastelfreak)
- Update documentation #7 (dhollinger)
- Prepare for 2.0.1 release #4 (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 Change Log was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 4.13.1 < 5.0.0)
- puppetlabs/concat (>= 2.2.1 < 5.0.0)
Copyright (C) 2014 David Hollinger III 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.