aboutsummaryrefslogtreecommitdiff
path: root/manifests/preseeded_package.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/preseeded_package.pp')
-rw-r--r--manifests/preseeded_package.pp18
1 files changed, 18 insertions, 0 deletions
diff --git a/manifests/preseeded_package.pp b/manifests/preseeded_package.pp
new file mode 100644
index 0000000..276c90f
--- /dev/null
+++ b/manifests/preseeded_package.pp
@@ -0,0 +1,18 @@
+define apt::preseeded_package ($content = "", $ensure = "installed") {
+ $seedfile = "/var/cache/local/preseeding/$name.seeds"
+ $real_content = $content ? {
+ "" => template ( "$debian_version/$name.seeds" ),
+ Default => $content
+ }
+
+ file{ $seedfile:
+ content => $real_content,
+ mode => 0600, owner => root, group => root,
+ }
+
+ package { $name:
+ ensure => $ensure,
+ responsefile => $seedfile,
+ require => File[$seedfile],
+ }
+}