summaryrefslogtreecommitdiff
path: root/manifests/os/arch.pp
blob: 5fbf5d1e9ff534003e01bcceba26c44cec5de86b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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/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",
  }

}