summaryrefslogtreecommitdiff
path: root/modules/networking/manifests/networkd.pp
blob: dec2e3352e560108ed272aca58ee5728c2ee74b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class networking::networkd (
  Boolean $notify_ = true,
  Boolean $manage_directory = true,
  String $root = '/',
  String $path = "${root}/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,
    }
  }
}