From dfa81fe29a6be169d6ed2803c4bedcd211b16d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 13 Jan 2022 23:15:11 +0100 Subject: Nspawn cleanup. --- manifests/os/arch.pp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'manifests/os/arch.pp') diff --git a/manifests/os/arch.pp b/manifests/os/arch.pp index e5fc210..d9bd258 100644 --- a/manifests/os/arch.pp +++ b/manifests/os/arch.pp @@ -1,14 +1,17 @@ define nspawn::os::arch ( - String $machine = $name, + String $template_name = $name, + String $template_dir = $nspawn::template_dir, ) { ensure_packages(['arch-install-scripts']) - $machine_path = "/var/lib/machines/${machine}" + $root = "${template_dir}/${template_name}" - exec { "/usr/bin/pacstrap '${machine_path}' base puppet": - creates => "${machine_path}/etc/os-release", + file { $root: + ensure => directory, + } -> exec { "/usr/bin/pacstrap '${root}' base puppet": + creates => "${root}/etc/os-release", + } -> nspawn::util::enable_networkd { $template_name: + template_dir => $template_dir, } - - nspawn::util::enable_networkd { $machine: } } -- cgit v1.2.3