summaryrefslogtreecommitdiff
path: root/modules/nspawn/manifests/os/debian.pp
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-01-02 04:31:50 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-01-02 04:44:39 +0100
commita261aa089f879b6854c7b8fc7676d6b23ac25588 (patch)
treefc7e5e7dd40cca83f2eb130a8c26066689a6cd89 /modules/nspawn/manifests/os/debian.pp
parentAdd debug notice. (diff)
downloadwebdav_server-a261aa089f879b6854c7b8fc7676d6b23ac25588.tar.gz
webdav_server-a261aa089f879b6854c7b8fc7676d6b23ac25588.tar.xz
Network rewrites.
Diffstat (limited to '')
-rw-r--r--modules/nspawn/manifests/os/debian.pp39
1 files changed, 9 insertions, 30 deletions
diff --git a/modules/nspawn/manifests/os/debian.pp b/modules/nspawn/manifests/os/debian.pp
index b8a1bd4..fbab9ac 100644
--- a/modules/nspawn/manifests/os/debian.pp
+++ b/modules/nspawn/manifests/os/debian.pp
@@ -2,48 +2,23 @@ define nspawn::os::debian (
String $os_version,
String $machine = $name,
) {
+
ensure_packages(['debootstrap'])
exec { "/usr/bin/deboostrap ${os_version} /var/lib/machines/${machine}":
creates => "/var/lib/machines/${machine}/etc/os-release",
}
- file { "/var/lib/machines/${machine}/etc/network/interfaces":
- ensure => file,
- content => @(EOF)
- # File managed by puppet
- # See interfaces(5)
- source-directory /etc/network/interfaces.d
- | EOF
- }
-
- file { "/var/lib/machines/${machine}/etc/network/interfaces.d":
- ensure => directory,
- }
-
- file { "/var/lib/machines/${machine}/etc/network/interfaces.d/puppet":
- ensure => file,
- content => @(EOF)
- # File managed by puppet
- auto host0
- # allow-hotplug host0
-
- iface host0 inet static
- address 10.0.0.42/23
- gateway 10.0.0.1
-
- iface host0 inet6 auto
- private 0
- | EOF
- }
-
$puppet_deb = "/var/lib/machines/${machine}/tmp/puppet7-release-${os_version}.deb"
file { $puppet_deb:
ensure => file,
source => "https://apt.puppet.com/puppet7-release-${os_version}.deb"
}
- if $facts['machined-info'][$machine]['State'] == 'running' {
+ $running = $facts['machined-info'][$machine] != Undef or $facts['machined-info'][$machine]['State'] == 'running'
+
+ if $running {
+ # TODO
notify { "Notify skipping ${machine} setup":
message => "Skipping setup for ${machine}, already running",
}
@@ -67,4 +42,8 @@ define nspawn::os::debian (
creates => "/var/lib/machines/${machine}/opt/puppetlabs/bin/puppet",
}
}
+
+ nspawn::util::disable_networking { $machine: }
+ nspawn::util::enable_networkd { $machine: }
+
}