summaryrefslogtreecommitdiff
path: root/manifests/os/arch.pp
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-01-01 23:07:49 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-01-01 23:20:10 +0100
commit337716a7f106d35cca86ad0ac69a080356dbc32f (patch)
treeb4ec65ddcf3ceaac2f93a81743f65aa3b788564a /manifests/os/arch.pp
parentSetup nspawn? (diff)
downloadnspawn-337716a7f106d35cca86ad0ac69a080356dbc32f.tar.gz
nspawn-337716a7f106d35cca86ad0ac69a080356dbc32f.tar.xz
Hopefully fix nspawn.
Diffstat (limited to 'manifests/os/arch.pp')
-rw-r--r--manifests/os/arch.pp43
1 files changed, 9 insertions, 34 deletions
diff --git a/manifests/os/arch.pp b/manifests/os/arch.pp
index 4f83546..5fbf5d1 100644
--- a/manifests/os/arch.pp
+++ b/manifests/os/arch.pp
@@ -8,7 +8,7 @@ define nspawn::os::arch (
creates => "/var/lib/machines/${machine}/etc/os-release",
}
- file { "/var/lib/machines/${machine}/etc/systemd/network.d/20-puppet.conf":
+ file { "/var/lib/machines/${machine}/etc/systemd/network/20-puppet.conf":
content => @(EOF)
[Match]
Name=host0
@@ -20,39 +20,14 @@ define nspawn::os::arch (
| EOF
}
- $symlinks = [
- [ '/etc/systemd/system/dbus-org.freedesktop.network1.service',
- '/usr/lib/systemd/system/systemd-networkd.service' ],
- [ '/etc/systemd/system/multi-user.target.wants/systemd-networkd.service',
- '/usr/lib/systemd/system/systemd-networkd.service' ],
- [ '/etc/systemd/system/sockets.target.wants/systemd-networkd.socket',
- '/usr/lib/systemd/system/systemd-networkd.socket' ],
- [ '/etc/systemd/system/sysinit.target.wants/systemd-network-generator.service',
- '/usr/lib/systemd/system/systemd-network-generator.service' ],
- [ '/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service',
- '/usr/lib/systemd/system/systemd-networkd-wait-online.service' ],
- ]
-
- $symlinks.each |$pair| {
- $where = $pair[0]
- $target = $pair[1]
- file { "/var/lib/machines/${machine}/${where}":
- ensure => link,
- target => $target,
- }
- }
-
-
- file { "/var/lib/machines/${machine}/etc/systemd/network.d/20-puppet.conf":
- content => @(EOF)
- [Match]
- Name=host0
-
- [Network]
- Address=10.0.0.43/23
- Gateway=10.0.0.1
- IPv6AcceptRA=1
- | EOF
+ 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",
}
}