summaryrefslogtreecommitdiff
path: root/manifests/os/arch.pp
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-01-02 04:31:50 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-01-02 04:44:39 +0100
commite3e75161d06387a979b8f4a04f406f9b54f8703e (patch)
tree85f1917c8ba2f0c416fcd1298d29c41ea0b58918 /manifests/os/arch.pp
parentMove paths. (diff)
downloadnspawn-e3e75161d06387a979b8f4a04f406f9b54f8703e.tar.gz
nspawn-e3e75161d06387a979b8f4a04f406f9b54f8703e.tar.xz
Network rewrites.
Diffstat (limited to '')
-rw-r--r--manifests/os/arch.pp32
1 files changed, 4 insertions, 28 deletions
diff --git a/manifests/os/arch.pp b/manifests/os/arch.pp
index 0affee1..e5fc210 100644
--- a/manifests/os/arch.pp
+++ b/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: }
}