From 4b4b4fea14363f6a7e7d1c8761d4557053fd6364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 3 May 2023 15:58:58 +0200 Subject: work --- manifests/networkd.pp | 4 ++-- manifests/networkd_instance.pp | 17 ++++++++++++++++- 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 { [] }, -- cgit v1.2.3