summaryrefslogtreecommitdiff
path: root/manifests/template_final.pp
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-01-13 23:15:11 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-01-13 23:53:26 +0100
commitdfa81fe29a6be169d6ed2803c4bedcd211b16d72 (patch)
tree77bd0d72e5fe48e07b5d7be5f7532b776f9c53ba /manifests/template_final.pp
parentRewrote mots of nspawn. (diff)
downloadnspawn-dfa81fe29a6be169d6ed2803c4bedcd211b16d72.tar.gz
nspawn-dfa81fe29a6be169d6ed2803c4bedcd211b16d72.tar.xz
Nspawn cleanup.
Diffstat (limited to 'manifests/template_final.pp')
-rw-r--r--manifests/template_final.pp28
1 files changed, 28 insertions, 0 deletions
diff --git a/manifests/template_final.pp b/manifests/template_final.pp
new file mode 100644
index 0000000..a198775
--- /dev/null
+++ b/manifests/template_final.pp
@@ -0,0 +1,28 @@
+define nspawn::template_final (
+ String $root,
+ String $puppet_server,
+ String $template = $name,
+) {
+ exec { "Enable puppet on ${template}":
+ command => [ '/usr/bin/systemd-nspawn',
+ '-M', $template,
+ '--quiet',
+ 'systemctl', 'enable', 'puppet',
+ ],
+ creates => "${root}/etc/systemd/system/multi-user.target.wants/puppet.service",
+ }
+
+ file { [ "${root}/etc/puppetlabs",
+ "${root}/etc/puppetlabs/puppet" ] :
+ ensure => directory,
+ }
+
+
+ file { "${root}/etc/puppetlabs/puppet/puppet.conf":
+ ensure => file,
+ content => @("EOF")
+ [main]
+ server = ${puppet_server}
+ | EOF
+ }
+}