summaryrefslogtreecommitdiff
path: root/modules/nspawn/manifests/os/arch.pp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nspawn/manifests/os/arch.pp')
-rw-r--r--modules/nspawn/manifests/os/arch.pp23
1 files changed, 14 insertions, 9 deletions
diff --git a/modules/nspawn/manifests/os/arch.pp b/modules/nspawn/manifests/os/arch.pp
index 5fbf5d1..0affee1 100644
--- a/modules/nspawn/manifests/os/arch.pp
+++ b/modules/nspawn/manifests/os/arch.pp
@@ -20,14 +20,19 @@ define nspawn::os::arch (
| 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",
+ 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",
+ }
}
-
}