diff --git a/conf/type/__package_apt/gencode-remote b/conf/type/__package_apt/gencode-remote index 370f0102..b2c7179d 100755 --- a/conf/type/__package_apt/gencode-remote +++ b/conf/type/__package_apt/gencode-remote @@ -27,8 +27,14 @@ else name="$__object_id" fi -state="$(cat "$__object/parameter/state")" +# Check for preseeding and add preseed as here document +if [ -f "$__object/parameter/preseed" ]; then + echo "debconf-set-selections << __file-eof" + cat "$(cat "$__object/parameter/preseed")" + echo "__file-eof" +fi +state="$(cat "$__object/parameter/state")" is_installed="$(grep "^Status: install ok installed" "$__object/explorer/pkg_status" || true)" case "$state" in diff --git a/conf/type/__package_apt/man.text b/conf/type/__package_apt/man.text index 0780124d..8b7476b4 100644 --- a/conf/type/__package_apt/man.text +++ b/conf/type/__package_apt/man.text @@ -25,6 +25,9 @@ OPTIONAL PARAMETERS name:: If supplied, use the name and not the object id as the package name. +preseed:: + If supplied, use the given filename as input for debconf-set-selections(1) + EXAMPLES -------- @@ -36,6 +39,9 @@ __package_apt zsh --state installed # In case you only want *a* webserver, but don't care which one __package_apt webserver --state installed --name nginx +# Install package with defaults (from a type) +__package_apt postfix --state installed --preseed "$__type/files/postfix-seed" + # Remove obsolete package __package_apt puppet --state deinstalled --------------------------------------------------------------------------------