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 } 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", } } }