summaryrefslogtreecommitdiff
path: root/manifests/os/arch.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/os/arch.pp')
-rw-r--r--manifests/os/arch.pp58
1 files changed, 58 insertions, 0 deletions
diff --git a/manifests/os/arch.pp b/manifests/os/arch.pp
new file mode 100644
index 0000000..4f83546
--- /dev/null
+++ b/manifests/os/arch.pp
@@ -0,0 +1,58 @@
+define nspawn::os::arch (
+ String $machine = $name,
+) {
+
+ 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.d/20-puppet.conf":
+ content => @(EOF)
+ [Match]
+ Name=host0
+
+ [Network]
+ Address=10.0.0.43/23
+ Gateway=10.0.0.1
+ IPv6AcceptRA=1
+ | 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
+ }
+
+}