Forked from Reid Vandewiele
- 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
Installs and configures autofs which provides automount functionality. Tested with Ubuntu 12.04, Ubuntu 14.04 and CentOS 7
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.
See also: autofs.conf man page
class { 'autofs':
mount_verbose => 'yes',
logging => 'verbose',
amd => {
dismount_interval => 600,
},
custom_config => {
'/expamle/mount' => {
map_type => 'file',
},
},
}autofs::mapfile{ 'auto.home':
directory => '/home',
options => '--timeout 300';
}autofs::mapfile{ 'auto.share':
directory => '/-',
options => '--timeout 300';
}autofs::mapfile{ 'auto.share':
ensure => absent,
directory => '/-';
}autofs::mapfile{ 'auto.home':
ensure => purged,
directory => '/home';
}autofs::mapfile{ 'auto.chroot':
directory => '/chroot',
maptype => 'program';
}autofs::include{ 'auto.local': }autofs::mount { 'remote':
mapfile => 'auto.share',
options => '-fstype=nfs,rw,bg',
map => 'nfsserver:/nfs/share';
}autofs::mount { '/share/remote':
mapfile => 'auto.share',
options => '-fstype=nfs,rw,bg',
map => 'nfsserver:/nfs/share';
}autofs::mount { '*':
mapfile => 'auto.home',
options => '-fstype=nfs,rw,bg',
map => 'nfsserver:/nfs/homes/&';
}autofs::mount { '*@auto.home2':
mount => '*',
mapfile => 'auto.home2',
options => '-fstype=nfs,rw,bg',
map => 'nfsserver:/nfs/homes/&';
}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/&'- autofs: Main class, includes all other classes.
- autofs::install: Handles the packages.
- autofs::config: Handles the configuration file.
- autofs::service: Handles the service.
- autofs::include: Adds additional includes to auto.master
- autofs::mapfile: Adds mapfile to auto.master
- autofs::mount: Adds mounts to mapfiles
Tells Puppet what the file owner of the generated config files. Valid options: valid unix user. Default value: 'root'
Tells Puppet what the file group of the generated config files. Valid options: valid unix group. Default value: 'root'
Tells Puppet what the name of the auto.master config file. Valid options: string. Default value: varies by operating system
Tells Puppet what the directory where is the master_config located. Valid options: string. Default value: varies by operating system
Tells Puppet whether the autofs package should be installed, and what version. Valid options: 'present', 'latest', or a specific version number. Default value: 'present'
Tells Puppet whether to manage the autofs package. Valid options: 'true' or 'false'. Default value: 'true'
Tells Puppet what autofs package to manage. Valid options: string. Default value: 'autofs' (autofs-ldap on debian familliy)
Tells Puppet whether to enable the autofs service at boot. Valid options: 'true' or 'false'. Default value: 'true'
Tells Puppet whether the autofs service should be running. Valid options: 'running' or 'stopped'. Default value: 'running'
Tells Puppet whether to manage the autofs service. Valid options: 'true' or 'false'. Default value: 'true'
Tells Puppet what autofs service to manage. Valid options: string. Default value: varies by operating system
Tells Puppet whether the autofs service has a restart option. Valid options: string. Default value: varies by operating system
Tells Puppet whether the autofs service has a status option. Valid options: string. Default value: varies by operating system
Tells Puppet the restart command of the autofs service. Usefull, if you want to reload autofs instead restart. Valid options: string. Default value: undef
Hash of autofs::mapfile resources. Valid options: hash. Default value: Empty hash
Hash of autofs::mount resources. Valid options: hash. Default value: Empty hash
Hash of autofs::include resources. Valid options: hash. Default value: Empty hash
Name of the mapfile to be included. Valid options: string. No default value
Order of the entry on the master_config config file (Will be passthrough to concat::fragment). Valid options: string. Default value: undef
Base directory for this mapfile (Use '/-' for direct mounts). Valid options: string. No default value
Name of the mapfile. Valid options: string. Default value: $name
Order of the entry on the master_config config file (Will be passthrough to concat::fragment). Valid options: string. Default value: undef
Hash of autofs::mount resources. All resources will be mapped to this mapfile. Valid options: hash. Default value: Empty hash
Name of the mount point. Valid options: string. Default value: $name
Name of the mapfile where is mount live. Valid options: string. No default value
Device, NFS server, local device or any other resource that can be mount.
Defines mount options.
Order of the entry on the master_config config file (Will be passthrough to concat::fragment). Valid options: string. Default value: undef
Hash of autofs::mount resources. All resources will be mapped to this mapfile. Valid options: hash. Default value: Empty hash
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
Feel free to open issues or pull request on the github repo site: https://github.com/jkroepke/puppet-module-autofs
To see who's already involved, see the list of contributors.