Defined Type: autofs::masterfile
- Defined in:
- manifests/masterfile.pp
Summary
Create a `$name.autofs` master entry file in `$autofs::master_conf_dir`Overview
This will only create the autofs master entry file.
-
If the map type is ‘file’ or unspecified, you will need to create the map file, e.g. using ‘autofs::mapfile`. Alternatively, use `autofs::map` which will create both the master entry file and its map file.
-
If the map type is ‘program’, you will need to ensure the specified executable is available and has the appropriate permissions.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'manifests/masterfile.pp', line 83
define autofs::masterfile (
Stdlib::Absolutepath $mount_point,
String $map,
Optional[Autofs::Maptype] $map_type = undef,
Optional[Enum['sun','hesiod']] $map_format = undef,
Optional[String] $options = undef
) {
include 'autofs'
# Validate format of the $map String for the subset of cases that we can!
if ($map_type in ['file','program']) {
if $map !~ Stdlib::Absolutepath {
fail('"$map" must be a Stdlib::Absolutepath when "$map_type" is not specified or is "file" or "program"')
}
}
$_content = epp("${module_name}/etc/auto.master.simp.d/entry.autofs.epp", {
'mount_point' => $mount_point,
'map' => $map,
'map_type' => $map_type,
'map_format' => $map_format,
'options' => $options
})
$_safe_name = regsubst(regsubst($name, '^/', ''), '(/|\s)', '__', 'G')
file { "${autofs::master_conf_dir}/${_safe_name}.autofs":
owner => 'root',
group => 'root',
mode => '0640',
content => $_content,
notify => Exec['autofs_reload']
}
}
|