15
16
17
18
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
|
# File 'manifests/network.pp', line 15
define systemd::network (
Enum['file', 'absent'] $ensure = file,
Stdlib::Absolutepath $path = '/etc/systemd/network',
Optional[String] $content = undef,
Optional[String] $source = undef,
Optional[Stdlib::Absolutepath] $target = undef,
String $owner = 'root',
String $group = 'root',
String $mode = '0444',
Boolean $show_diff = true,
Boolean $restart_service = true,
) {
include systemd
if $restart_service and $systemd::manage_networkd and $facts['systemd_internal_services'] and $facts['systemd_internal_services']['systemd-networkd.service'] {
$notify = Service['systemd-networkd']
} else {
$notify = undef
}
if $ensure == 'file' {
if $content =~ Undef and $source =~ Undef {
fail('Either content or source must be set')
}
if $content =~ NotUndef and $source =~ NotUndef {
fail('Either content or source must be set but not both')
}
}
file { "${path}/${name}":
ensure => $ensure,
content => $content,
source => $source,
target => $target,
owner => $owner,
group => $group,
mode => $mode,
show_diff => $show_diff,
notify => $notify,
}
}
|