Defined Type: autofs::mapfile
- Defined in:
- manifests/mapfile.pp
Summary
Defined type to manage overall autofs map filesOverview
[View source]
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'manifests/mapfile.pp', line 19
define autofs::mapfile (
Enum['present', 'absent'] $ensure = 'present',
Stdlib::Absolutepath $path = $title,
Array[Autofs::Fs_mapping] $mappings = [],
Boolean $replace = true,
Boolean $execute = false,
) {
include 'autofs'
unless $autofs::package_ensure == 'absent' {
if $autofs::reload_command {
Concat {
before => Service[$autofs::service_name],
notify => Exec['automount-reload'],
}
} else {
Concat {
notify => Service[$autofs::service_name],
}
}
}
$mapfile_mode = $execute ? {
true => '0755',
false => '0644'
}
concat { $path:
ensure => $ensure,
owner => $autofs::map_file_owner,
group => $autofs::map_file_group,
mode => $mapfile_mode,
replace => $replace,
require => Class['autofs::package'],
warn => template('autofs/mapfile.banner.erb'),
}
if $ensure == 'present' {
$mappings.each |$mapping| {
autofs::mapping { "${path}:${mapping[key]}":
ensure => 'present',
mapfile => $path,
* => $mapping,
}
}
}
}
|