Add systemd module, required by rabbitmq
[mirror/dsa-puppet.git] / 3rdparty / modules / systemd / manifests / network.pp
diff --git a/3rdparty/modules/systemd/manifests/network.pp b/3rdparty/modules/systemd/manifests/network.pp
new file mode 100644 (file)
index 0000000..5a49005
--- /dev/null
@@ -0,0 +1,30 @@
+# -- Define: systemd::network
+# Creates network config for systemd-networkd
+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,
+  Boolean $restart_service               = true,
+){
+
+  include systemd
+
+  if $restart_service and $systemd::manage_networkd {
+    $notify = Service['systemd-networkd']
+  } else {
+    $notify = undef
+  }
+
+  file { "${path}/${name}":
+    ensure  => $ensure,
+    content => $content,
+    source  => $source,
+    target  => $target,
+    owner   => 'root',
+    group   => 'root',
+    mode    => '0444',
+    notify  => $notify,
+  }
+}