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
71
72
73
|
# File 'manifests/config/fragment.pp', line 38
define icinga2::config::fragment(
String $content,
Stdlib::Absolutepath $target,
String $code_name = $title,
Variant[String, Integer] $order = '00',
) {
case $::facts['os']['family'] {
'windows': {
$_content = regsubst($content, '\n', "\r\n", 'EMG')
} # windows
default: {
Concat {
owner => $::icinga2::globals::user,
group => $::icinga2::globals::group,
mode => '0640',
}
$_content = $content
} # default
}
if !defined(Concat[$target]) {
concat { $target:
ensure => present,
tag => 'icinga2::config::file',
warn => true,
}
}
concat::fragment { "icinga2::config::${code_name}":
target => $target,
content => $_content,
order => $order,
}
}
|