summaryrefslogtreecommitdiff
path: root/manifests/networkd.pp
blob: 861ec3900d50a7abc80bfeab26092094aa5121f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class networking::networkd (
  Boolean $notify_ = true,
  Boolean $manage_directory = true,
  String $path = "/etc/systemd/network",
) {
  if $manage_directory {
    file { $path:
      ensure  => directory,
      purge   => true,
      recurse => true,
    }
  }

  if $notify_ {
    exec { 'reload networkd':
      command => 'systemctl reload-or-restart systemd-networkd',
      path        => ['/bin', '/usr/bin',],
      refreshonly => true,
    }
  }

  service { 'networkd':
    ensure => running,
    enable => true,
  }
}