add the preseeded_package define which simplifies apt preseeding

automatically making sure that the preseeding directories are present
and pulling the seed file from templates/$debian_version/$name.seeds
which enables you to define things such as:

apt::preseeded_package { [ locales, popularity-contest, apt-listchanges, apticron]: }

and the .seed files will be automatically pulled and populated
This commit is contained in:
Micah Anderson 2008-09-29 13:39:18 -04:00
parent ee506f7586
commit 377e095431

View file

@ -133,8 +133,55 @@ class apt {
}
}
}
}
# workaround for preseeded_package component
file { "/var/cache": ensure => directory }
file { "/var/cache/local": ensure => directory }
file { "/var/cache/local/preseeding/": ensure => directory }
define 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],
}
}
# workaround for preseeded_package component
file { "/var/cache": ensure => directory }
file { "/var/cache/local": ensure => directory }
file { "/var/cache/local/preseeding/": ensure => directory }
define 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],
}
}
}
class dselect {
# suppress annoying help texts of dselect