summaryrefslogtreecommitdiff
path: root/manifests/util/enable_networkd.pp
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-06-21 21:45:18 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-06-21 21:45:18 +0200
commit1b7a898c7a336778c0e43ce6e26a36e43cf1080b (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /manifests/util/enable_networkd.pp
parentReordering. (diff)
downloadnspawn-1b7a898c7a336778c0e43ce6e26a36e43cf1080b.tar.gz
nspawn-1b7a898c7a336778c0e43ce6e26a36e43cf1080b.tar.xz
Remove everything.
Remove everything in the module, to make room for a new module in its place (but keeping the history, just in case). The problem with this module was that it tried way to hard to handle the machines by itself, while that should be done outside puppet. The new module will have a much simpler idea of how to provission, not attempt to build machines from scratch, and especially not do anything expensive.
Diffstat (limited to 'manifests/util/enable_networkd.pp')
-rw-r--r--manifests/util/enable_networkd.pp39
1 files changed, 0 insertions, 39 deletions
diff --git a/manifests/util/enable_networkd.pp b/manifests/util/enable_networkd.pp
deleted file mode 100644
index 40cb3d9..0000000
--- a/manifests/util/enable_networkd.pp
+++ /dev/null
@@ -1,39 +0,0 @@
-define nspawn::util::enable_networkd (
- String $template_name = $name,
- String $template_dir = $nspawn::template_dir,
- String $root = "${template_dir}/${template_name}",
-) {
-
- networking::networkd_instance { "Initial networking on ${template_name}":
- priority => 99,
- filename => 'puppet-initial',
- path => "${root}/${networking::networkd::path}",
- content => {
- 'Match' => {
- 'Name' => 'host0',
- },
- 'Network' => {
- 'DHCP' => 'ipv4',
- 'IPv6AcceptRA' => 1,
- },
- },
- }
-
- $running = $facts['machined-info'][$template_name] != undef
- and $facts['machined-info'][$template_name]['State'] == 'running'
-
- $cmd = if $running {
- [ 'systemctl', '-M', $template_name, 'enable', 'systemd-networkd' ]
- } else {
- [ 'systemd-nspawn', '-M', $template_name, '--quiet',
- 'systemctl', 'enable', 'systemd-networkd' ]
- }
-
- exec { "Enable systemd-networkd on ${template_name}":
- command => $cmd,
- path => [ '/bin', '/usr/bin', ],
- # among others
- creates => "${root}/etc/systemd/system/multi-user.target.wants/systemd-networkd.service",
- }
-
-}