From c6fc4d6204cf384f0e8b6d9c1a9b4a7a151e2dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 23 Jun 2023 18:39:06 +0200 Subject: Config base. --- manifests/init.pp | 6 +++++- manifests/machine.pp | 9 +-------- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index f30ed61..fee1e9a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,7 +14,11 @@ # @param purge # Should old .nspawn files be purged. class nspawn ( - Nspawn::Systemd::Nspawn $config, + Nspawn::Systemd::Nspawn $config = { + 'Exec' => {}, + 'Files' => {}, + 'Network' => {}, + }, Stdlib::Absolutepath $template_dir = '/var/lib/templates', Hash[String, Hash[String, Any]] $machines = {}, Boolean $purge = true, diff --git a/manifests/machine.pp b/manifests/machine.pp index a0eebc4..25ee47c 100644 --- a/manifests/machine.pp +++ b/manifests/machine.pp @@ -44,14 +44,7 @@ define nspawn::machine ( 'override' => $config, } - # Empty base config ensuring that all sections are present. - $config_base = { - 'Exec' => {}, - 'Files' => {}, - 'Network' => {}, - } - - $final_config = $config_base + $almost_final_config + $final_config = $nspawn::config_base + $almost_final_config file { "${nspawn::nspawn_dir}/${name}.nspawn": ensure => $ensure, -- cgit v1.2.3