Version information
This version is compatible with:
- Puppet Enterprise 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, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
- Puppet >= 4.10.0 < 8.0.0
- Gentoo, Archlinux , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'jkroepke-autofs', '6.0.0'
Learn more about managing modules with a PuppetfileDocumentation
autofs puppet module
Forked from Reid Vandewiele
Table of Contents
- Description
- 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
Description
Installs and configures autofs which provides automount functionality. Tested with Ubuntu 12.04, Ubuntu 14.04 and CentOS 7
Setup
Beginning with autofs
include 'autofs'
is enough to get you up and running. If you wish to pass in parameters specifying which servers to use, then:
class { 'autofs':
package_manage => false,
service_restart => '/usr/bin/systemctl reload autofs';
}
autofs::package_manage: false
autofs::service_restart: '/usr/bin/systemctl reload autofs'
See puppet documentation for more informations about automatic lookup of class parameters.
Usage
Configure autofs
See also: autofs.conf man page
class { 'autofs':
mount_verbose => 'yes',
logging => 'verbose',
amd => {
dismount_interval => 600,
},
custom_config => {
'/expamle/mount' => {
map_type => 'file',
},
},
}
Added a map file
autofs::mapfile{ 'auto.home':
directory => '/home',
options => '--timeout 300';
}
Added a map file with direct mount
autofs::mapfile{ 'auto.share':
directory => '/-',
options => '--timeout 300';
}
Remove a no-longer-needed map file
autofs::mapfile{ 'auto.share':
ensure => absent,
directory => '/-';
}
Remove a no-longer-needed map file and purge the mount directory:
autofs::mapfile{ 'auto.home':
ensure => purged,
directory => '/home';
}
Added a map file with a non-'file' type
autofs::mapfile{ 'auto.chroot':
directory => '/chroot',
maptype => 'program';
}
Include an other master config
autofs::include{ 'auto.local': }
Adding a mount
autofs::mount { 'remote':
mapfile => 'auto.share',
options => '-fstype=nfs,rw,bg',
map => 'nfsserver:/nfs/share';
}
Adding a mount to a direct mount mapfile
autofs::mount { '/share/remote':
mapfile => 'auto.share',
options => '-fstype=nfs,rw,bg',
map => 'nfsserver:/nfs/share';
}
Adding a mount with dynamic mount points
autofs::mount { '*':
mapfile => 'auto.home',
options => '-fstype=nfs,rw,bg',
map => 'nfsserver:/nfs/homes/&';
}
Adding a mount with the same name on other mapfiles
autofs::mount { '*@auto.home2':
mount => '*',
mapfile => 'auto.home2',
options => '-fstype=nfs,rw,bg',
map => 'nfsserver:/nfs/homes/&';
}
Using hiera
autofs::includes:
auto.local: {}
autofs::mapfiles:
auto.home:
directory: '/home'
options: '--timeout 300'
auto.share:
directory: '/-'
options: '--timeout 600'
autofs::mounts:
remote:
mapfile: 'auto.share'
options: '-fstype=nfs,rw,bg'
map: 'nfsserver:/nfs/share'
'/share/remote':
mapfile: 'auto.share'
options: '-fstype=nfs,rw,bg'
map: 'nfsserver:/nfs/share'
'*':
mapfile: 'auto.home'
options: '-fstype=nfs,rw,bg'
map: 'nfsserver:/nfs/homes/&'
'*@auto.home2':
mount: '*'
mapfile: 'auto.home2'
options: '-fstype=nfs,rw,bg'
map: 'nfsserver:/nfs/homes/&'
Reference
Classes
Public Classes
- autofs: Main class, includes all other classes.
Private Classes
- autofs::install: Handles the packages.
- autofs::config: Handles the configuration file.
- autofs::service: Handles the service.
Types
- autofs::include: Adds additional includes to auto.master
- autofs::mapfile: Adds mapfile to auto.master
- autofs::mount: Adds mounts to mapfiles
Parameters
The following parameters are available in the ::autofs
class:
config_file_owner
Tells Puppet what the file owner of the generated config files. Valid options: valid unix user. Default value: 'root'
config_file_group
Tells Puppet what the file group of the generated config files. Valid options: valid unix group. Default value: 'root'
master_config
Tells Puppet what the name of the auto.master config file. Valid options: string. Default value: varies by operating system
map_config_dir
Tells Puppet what the directory where is the master_config
located. Valid options: string. Default value: varies by operating system
package_ensure
Tells Puppet whether the autofs package should be installed, and what version. Valid options: 'present', 'latest', or a specific version number. Default value: 'present'
package_manage
Tells Puppet whether to manage the autofs package. Valid options: 'true' or 'false'. Default value: 'true'
package_name
Tells Puppet what autofs package to manage. Valid options: string. Default value: 'autofs' (autofs-ldap on debian familliy)
service_enable
Tells Puppet whether to enable the autofs service at boot. Valid options: 'true' or 'false'. Default value: 'true'
service_ensure
Tells Puppet whether the autofs service should be running. Valid options: 'running' or 'stopped'. Default value: 'running'
service_manage
Tells Puppet whether to manage the autofs service. Valid options: 'true' or 'false'. Default value: 'true'
service_name
Tells Puppet what autofs service to manage. Valid options: string. Default value: varies by operating system
service_hasrestart
Tells Puppet whether the autofs service has a restart option. Valid options: string. Default value: varies by operating system
service_hasstatus
Tells Puppet whether the autofs service has a status option. Valid options: string. Default value: varies by operating system
service_restart
Tells Puppet the restart command of the autofs service. Usefull, if you want to reload autofs instead restart. Valid options: string. Default value: undef
mapfiles
Hash of autofs::mapfile
resources. Valid options: hash. Default value: Empty hash
mounts
Hash of autofs::mount
resources. Valid options: hash. Default value: Empty hash
includes
Hash of autofs::include
resources. Valid options: hash. Default value: Empty hash
The following parameters are available in the ::autofs::include
type:
mapfile
Name of the mapfile to be included. Valid options: string. No default value
order
Order of the entry on the master_config
config file (Will be passthrough to concat::fragment
). Valid options: string. Default value: undef
The following parameters are available in the ::autofs::mapfile
type:
directory
Base directory for this mapfile (Use '/-' for direct mounts). Valid options: string. No default value
mapfile
Name of the mapfile. Valid options: string. Default value: $name
order
Order of the entry on the master_config
config file (Will be passthrough to concat::fragment
). Valid options: string. Default value: undef
mounts
Hash of autofs::mount
resources. All resources will be mapped to this mapfile. Valid options: hash. Default value: Empty hash
The following parameters are available in the ::autofs::mount
type:
mount
Name of the mount point. Valid options: string. Default value: $name
mapfile
Name of the mapfile where is mount live. Valid options: string. No default value
map
Device, NFS server, local device or any other resource that can be mount.
options
Defines mount options.
order
Order of the entry on the master_config
config file (Will be passthrough to concat::fragment
). Valid options: string. Default value: undef
mounts
Hash of autofs::mount
resources. All resources will be mapped to this mapfile. Valid options: hash. Default value: Empty hash
Limitations
Currently it is not possible to define mounts directly on the auto.master. You must define a mapfile.
Only tested with Ubuntu 14.04, CentOS 6 and CentOS 7. Other OS'es might work, but are not tested
Development
Feel free to open issues or pull request on the github repo site: https://github.com/jkroepke/puppet-module-autofs
Contributors
To see who's already involved, see the list of contributors.
2021-05-05 Release 6.0.0
- Add Support for OpenSUSE 15 (#29; rehanone)
- Update PDK to 2.1 (#30; jkroepke)
- Drop support for Debian 6 & 7, Ubuntu 12.04, RHEL 5 and CentOS 5.
2020-12-27 Release 5.2.0
- Support Puppet 7
- Update PDK to 1.18
2020-05-02 Release 5.1.0
- Support & Tests for ubuntu 20.04 (#26; rehanone)
- Update PDK to 1.17 (#25; jkroepke)
- Support Enterprise Linux 8 (#24; jkroepke)
2019-08-17 Release 5.0.1
- Fixed documentation issue (#22; jkroepke)
2019-08-17 Release 5.0.0
- Support Debian 10 and bump max version dependencies (#19; jkroepke)
- Add puppet-lint-absolute_classname-check (#20; jkroepke)
- Added configuration for autofs.conf (#21; jkroepke)
2019-05-01 Release 4.1.0
2019-03-17 Release 4.0.1
- Fix forge deployment
2019-03-17 Release 4.0.0
- Added Puppet 6
- Added Debian 9
- Upgrade PDK & modernize module (#15; jkroepke)
2018-06-15 Release 3.0.0
- Added acceptance tests for various supported platforms. (#13; rehanone)
- Converted
params.pp
to hiera5 module data pattern. (#12; rehanone) - Added Puppet 4 types for all parameters. (#11; rehanone)
- Converted the module to use Puppet Development Kit. (#10; rehanone)
- Fix syntax issues in documentation
2017-03-04 Release 2.0.4
- Set default mount options to
-rw
to prevent autofs syntax errors. - Reduce the size of the forge archive
2016-10-21 Release 2.0.3
- Added more spec files (#5)
- Add parameter maptype (#4; jearls)
- Add ensure parameter to ::autofs::mapfile (#2; jearls)
- Added spec tests from voxpupuli
2016-04-12 Release 2.0.2
- Added Gentoo support (#1; daugustin)
- Fixed documentation issues
2016-02-15 Release 2.0.1
- Fixed documentation issues
2016-02-15 Release 2.0.0
- Refactor Module
- Added support for concat 2
- Added parameter for package and service parameters
- Fixed "Duplicate declaration"-Errors
- Added ArchLinux Support
2015-06-16 Release 1.1.0 (Reid Vandewiele)
- Enable TravisCI and add Gemfile
- Add metadata.json
- fixed puppet-lint errors
- added concat resource
- added concat resource
- Remove deprecated concat::setup class
- fix lint warning
- just install autofs-ldap, dependencies will take care of the rest
- Put options at the end only in master file. Else between key and location
- Fix ordering issue with preamble fragment
- Adding a puppet comment in the managed files
2013-09-28 Release 1.0.0 (Reid Vandewiele)
Summary:
Improved validation and permit ensuring the absense of mounts
Backwards-incompatible changes:
- Update dependency on concat to use puppetlabs-concat
Features:
- Improved input validation
- Add autofs direct mount
- Add ensure parameter to autofs::mount
Dependencies
- puppetlabs/stdlib (>= 4.0.0 < 8.0.0)
- puppetlabs/concat (>= 4.0.0 < 8.0.0)
Copyright (C) 2012 Portland State University 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.