summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-05-03 15:58:58 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-05-03 15:58:58 +0200
commit4b4b4fea14363f6a7e7d1c8761d4557053fd6364 (patch)
tree27410138084a6e225e1c80c95a4c4f6fe77838a2
parentFix repack function. (diff)
downloadnetworking-4b4b4fea14363f6a7e7d1c8761d4557053fd6364.tar.gz
networking-4b4b4fea14363f6a7e7d1c8761d4557053fd6364.tar.xz
work
-rw-r--r--manifests/networkd.pp4
-rw-r--r--manifests/networkd_instance.pp17
2 files changed, 18 insertions, 3 deletions
diff --git a/manifests/networkd.pp b/manifests/networkd.pp
index 5b34a32..7c06b58 100644
--- a/manifests/networkd.pp
+++ b/manifests/networkd.pp
@@ -1,7 +1,7 @@
class networking::networkd (
Boolean $notify_ = true,
Boolean $manage_directory = true,
- String $path = "/etc/systemd/network",
+ String $path = '/etc/systemd/network',
) {
if $manage_directory {
file { $path:
@@ -14,7 +14,7 @@ class networking::networkd (
# Why this instead of `networkctl reload`?
if $notify_ {
exec { 'reload networkd':
- command => 'systemctl reload-or-restart systemd-networkd',
+ command => 'systemctl reload-or-restart systemd-networkd',
path => ['/bin', '/usr/bin',],
refreshonly => true,
}
diff --git a/manifests/networkd_instance.pp b/manifests/networkd_instance.pp
index 07465b6..651f8ce 100644
--- a/manifests/networkd_instance.pp
+++ b/manifests/networkd_instance.pp
@@ -9,11 +9,26 @@ define networking::networkd_instance (
String $file = "${path}/${real_filename}",
) {
- include ::networking::networkd
+ require ::networking::networkd
file { $file:
ensure => $ensure,
+ owner => 'systemd-network',
content => epp('networking/unit_file.epp', {
+ # Keys are unit file sections
+ # Values are list of section content, so
+ # {
+ # 'Section' => [
+ # {
+ # 'key': 'value',
+ # 'mvalued': ['v1', 'v2'],
+ # }
+ # ]
+ # }
+ # [Section]
+ # key=value
+ # mvalued=v1
+ # mvalued=v2
data => networking::repack($content),
}),
notify => if $networking::networkd::notify_ { Exec['reload networkd'] } else { [] },