Version information
This version is compatible with:
- Puppet Enterprise >= 3.2.0 < 2015.4.0
- Puppet >= 3.2.0 < 5.0.0
- Gentoo, Archlinux , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'jkroepke-autofs', '2.0.3'
Learn more about managing modules with a PuppetfileDocumentation
autofs
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'
Usage
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.
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 (>= 3.0.0 < 5.0.0)
- puppetlabs/concat (>= 1.0.4 < 3.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.