summaryrefslogtreecommitdiff
path: root/modules/nspawn/manifests/os/arch.pp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nspawn/manifests/os/arch.pp')
-rw-r--r--modules/nspawn/manifests/os/arch.pp32
1 files changed, 4 insertions, 28 deletions
diff --git a/modules/nspawn/manifests/os/arch.pp b/modules/nspawn/manifests/os/arch.pp
index 0affee1..e5fc210 100644
--- a/modules/nspawn/manifests/os/arch.pp
+++ b/modules/nspawn/manifests/os/arch.pp
@@ -4,35 +4,11 @@ define nspawn::os::arch (
ensure_packages(['arch-install-scripts'])
- exec { "/usr/bin/pacstrap /var/lib/machines/${machine} base puppet":
- creates => "/var/lib/machines/${machine}/etc/os-release",
- }
-
- file { "/var/lib/machines/${machine}/etc/systemd/network/20-puppet.conf":
- content => @(EOF)
- [Match]
- Name=host0
+ $machine_path = "/var/lib/machines/${machine}"
- [Network]
- Address=10.0.0.43/23
- Gateway=10.0.0.1
- IPv6AcceptRA=1
- | EOF
+ exec { "/usr/bin/pacstrap '${machine_path}' base puppet":
+ creates => "${machine_path}/etc/os-release",
}
- if $facts['machined-info'][$machine]['State'] == 'running' {
- notify { "Notify skipping ${machine} setup":
- message => "Skipping setup for ${machine}, already running",
- }
- } else {
- exec { "Enable systemd-networkd on ${machine}":
- command => [ '/usr/bin/systemd-nspawn',
- '-M', $machine,
- '--quiet',
- 'systemctl', 'enable', 'systemd-networkd',
- ],
- # among others
- creates => "/var/lib/machines/${machine}/etc/systemd/system/multi-user.target.wants/systemd-networkd.service",
- }
- }
+ nspawn::util::enable_networkd { $machine: }
}