5a490051b72fe17261098f023a07d0cb93037289
[mirror/dsa-puppet.git] / 3rdparty / modules / systemd / manifests / network.pp
1 # -- Define: systemd::network
2 # Creates network config for systemd-networkd
3 define systemd::network (
4   Enum['file', 'absent'] $ensure         = file,
5   Stdlib::Absolutepath $path             = '/etc/systemd/network',
6   Optional[String] $content              = undef,
7   Optional[String] $source               = undef,
8   Optional[Stdlib::Absolutepath] $target = undef,
9   Boolean $restart_service               = true,
10 ){
11
12   include systemd
13
14   if $restart_service and $systemd::manage_networkd {
15     $notify = Service['systemd-networkd']
16   } else {
17     $notify = undef
18   }
19
20   file { "${path}/${name}":
21     ensure  => $ensure,
22     content => $content,
23     source  => $source,
24     target  => $target,
25     owner   => 'root',
26     group   => 'root',
27     mode    => '0444',
28     notify  => $notify,
29   }
30 }