diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/package.pp | 25 | ||||
-rw-r--r-- | manifests/preseeded_package.pp | 25 |
2 files changed, 30 insertions, 20 deletions
diff --git a/manifests/package.pp b/manifests/package.pp new file mode 100644 index 0000000..b2ae79d --- /dev/null +++ b/manifests/package.pp @@ -0,0 +1,25 @@ +# Install a package with a preseed file to automatically answer some questions. +define apt::package ( + $ensure = 'present', + $seedfile_content = '', +) { + + $seedfile = "/var/cache/local/preseeding/${name}.seeds" + $real_seedfile_content = $seedfile_content ? { + '' => template ( "site_apt/${::debian_codename}/${name}.seeds" ), + default => $seedfile_content, + } + + file { $seedfile: + content => $real_seedfile_content, + mode => '0600', + owner => 'root', + group => 0, + } + + package { $name: + ensure => $ensure, + responsefile => $seedfile, + require => File[$seedfile], + } +} diff --git a/manifests/preseeded_package.pp b/manifests/preseeded_package.pp index 29a981e..e1d1dcc 100644 --- a/manifests/preseeded_package.pp +++ b/manifests/preseeded_package.pp @@ -1,26 +1,11 @@ -# Install a package with a preseed file to automatically answer some questions. - +# This is a wrapper that will be removed after a while define apt::preseeded_package ( $ensure = 'present', $content = '', ) { - - $seedfile = "/var/cache/local/preseeding/${name}.seeds" - $real_content = $content ? { - '' => template ( "site_apt/${::debian_codename}/${name}.seeds" ), - default => $content, - } - - file { $seedfile: - content => $real_content, - mode => '0600', - owner => 'root', - group => 0, - } - - package { $name: - ensure => $ensure, - responsefile => $seedfile, - require => File[$seedfile], + warning('apt::preseeded_package is deprecated! you should now use apt::package instead.') + apt::package { $name: + ensure => $ensure, + content => $content, } } |