summaryrefslogtreecommitdiff
path: root/manifests/util/disable_networking.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/util/disable_networking.pp')
-rw-r--r--manifests/util/disable_networking.pp24
1 files changed, 6 insertions, 18 deletions
diff --git a/manifests/util/disable_networking.pp b/manifests/util/disable_networking.pp
index 22d431f..186d096 100644
--- a/manifests/util/disable_networking.pp
+++ b/manifests/util/disable_networking.pp
@@ -1,25 +1,13 @@
define nspawn::util::disable_networking (
String $template_name = $name,
String $template_dir = $nspawn::template_dir,
- String $template_path = "${template_dir}/${template_name}.base",
+ String $template_path = "${template_dir}/${template_name}",
) {
-
- $running = $facts['machined-info'][$template_name] != undef
- and $facts['machined-info'][$template_name]['State'] == 'running'
-
- $cmd = if $running {
- [ 'systemctl', '-M', $template_name, 'disable', 'networking' ]
- } else {
- [ 'systemd-nspawn', '-M', $template_name, '--quiet',
- 'systemctl', 'disable', 'networking' ]
+ # Manually masking instead of trying to disable/mask it through
+ # systemd, since this is MUCH easier to do whith puppet.
+ file { "${template_path}/etc/systemd/system/networking.service":
+ ensure => link,
+ target => '/dev/null',
}
-
- exec { "Disable networking on ${template_name}":
- command => $cmd,
- path => [ '/bin', '/usr/bin', ],
- # among others
- # creates => "${machine_path}/etc/systemd/system/multi-user.target.wants/systemd-networkd.service",
- }
-
}