diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-06-23 18:39:06 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-06-23 18:39:06 +0200 |
commit | c6fc4d6204cf384f0e8b6d9c1a9b4a7a151e2dc2 (patch) | |
tree | 9b4629505f993972a7547d3a4ed79900c057b254 | |
parent | Config base. (diff) | |
download | nspawn-c6fc4d6204cf384f0e8b6d9c1a9b4a7a151e2dc2.tar.gz nspawn-c6fc4d6204cf384f0e8b6d9c1a9b4a7a151e2dc2.tar.xz |
Config base.
-rw-r--r-- | manifests/init.pp | 6 | ||||
-rw-r--r-- | manifests/machine.pp | 9 |
2 files changed, 6 insertions, 9 deletions
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, |