Defined Type: autofs::mapfile
- Defined in:
- manifests/mapfile.pp
Summary
Create an autofs map fileOverview
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.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'manifests/mapfile.pp', line 70
define autofs::mapfile (
Variant[Autofs::Directmapping, Array[Autofs::Indirectmapping,1]] $mappings,
Optional[Stdlib::Absolutepath] $maps_dir = undef
) {
include 'autofs'
if $maps_dir =~ Undef {
$_maps_dir = $autofs::maps_dir
} else {
$_maps_dir = $maps_dir
}
$_safe_name = regsubst(regsubst($name, '^/', ''), '(/|\s)', '__', 'G')
$_map_file = "${_maps_dir}/${_safe_name}.map"
file { $_map_file:
owner => 'root',
group => 'root',
mode => '0640',
content => epp("${module_name}/etc/autofs.maps.simp.d/map.epp", {
'mappings' => $mappings} )
}
if $mappings =~ Autofs::Directmapping {
# Direct map changes are only picked up if the autofs service is reloaded
File[$_map_file] ~> Exec['autofs_reload']
}
}
|