From fe6c1c21b1acec8b8eb0e70b608c9de4bce349dd Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 13 Jul 2017 11:40:06 +0200 Subject: [PATCH] manage systemd-networkd in init.pp --- manifests/init.pp | 9 ++++++++- manifests/network.pp | 8 -------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index b65b2e44..e1bd80fa 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,7 +1,8 @@ # -- Class systemd # This module allows triggering systemd commands once for all modules class systemd ( - $service_limits = {} + $service_limits = {}, + Boolean $manage_networkd = true, ){ Exec { @@ -21,4 +22,10 @@ create_resources('systemd::service_limits', $service_limits, {}) + if $manage_networkd { + service{'systemd-networkd': + ensure => 'running', + enable => true, + } + } } diff --git a/manifests/network.pp b/manifests/network.pp index 00b5705f..4549e94c 100644 --- a/manifests/network.pp +++ b/manifests/network.pp @@ -7,18 +7,10 @@ Optional[String] $source = undef, Optional[Stdlib::Absolutepath] $target = undef, Boolean $restart_service = true, - Boolean $manage_service = true, ){ include ::systemd - if $manage_service { - service{'systemd-networkd': - ensure => 'running', - enabled => true, - } - } - if $restart_service { $notify = Service['systemd-networkd'] } else {