Defined Type: haproxy::mapfile
- Defined in:
- manifests/mapfile.pp
Summary
Manage an HAProxy map file as documented in https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#7.3.1-mapOverview
Note:
A map file contains one key + value per line. These key-value pairs are specified in the ‘mappings` array or by additional `haproxy::mapfile::entry` definitions.
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 66 67 68 69 70 |
# File 'manifests/mapfile.pp', line 37
define haproxy::mapfile (
Array[Variant[String, Hash]] $mappings = [],
Enum['present', 'absent'] $ensure = 'present',
String $owner = 'root',
String $group = 'root',
String $mode = '0644',
Array $instances = ['haproxy'],
) {
$mapfile_name = $title
$_instances = flatten($instances)
$_mapfile_name = "${haproxy::config_dir}/${mapfile_name}.map"
concat { "haproxy_mapfile_${mapfile_name}":
ensure => $ensure,
owner => $owner,
group => $group,
mode => $mode,
path => $_mapfile_name,
notify => Haproxy::Service[$_instances],
}
$parameters = {
'mappings' => $mappings,
'mapfile_name' => $mapfile_name,
}
concat::fragment { "haproxy_mapfile_${mapfile_name}-top":
target => $_mapfile_name,
content => epp('haproxy/haproxy_mapfile.epp', $parameters),
order => '00',
}
}
|