summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-09-05 06:17:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-09-05 07:15:17 +0000
commit746e48f6f2591a745d638a1d18daa3249f986c33 (patch)
tree4bbd084230ec774393700ad393848485c6f94a9a
parentAdding tsig debconf handling for dehydrated-nsupdate. (diff)
downloadopen-infrastructure-service-tools-746e48f6f2591a745d638a1d18daa3249f986c33.tar.xz
open-infrastructure-service-tools-746e48f6f2591a745d638a1d18daa3249f986c33.zip
Adding domain preseeding for dehydrated.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/open-infrastructure-dehydrated-tools.config6
-rwxr-xr-xdebian/open-infrastructure-dehydrated-tools.postinst36
-rw-r--r--debian/open-infrastructure-dehydrated-tools.templates21
3 files changed, 43 insertions, 20 deletions
diff --git a/debian/open-infrastructure-dehydrated-tools.config b/debian/open-infrastructure-dehydrated-tools.config
index 6c7a683..5d062af 100644
--- a/debian/open-infrastructure-dehydrated-tools.config
+++ b/debian/open-infrastructure-dehydrated-tools.config
@@ -60,11 +60,15 @@ then
fi
db_settitle open-infrastructure-dehydrated-tools/title
-db_input low open-infrastructure-dehydrated-tools/register "${REGISTER}" || true
+db_input low open-infrastructure-dehydrated-tools/domains "${DOMAINS}" || true
db_go
db_settitle open-infrastructure-dehydrated-tools/title
db_input low open-infrastructure-dehydrated-tools/tsig "${TSIG}" || true
db_go
+db_settitle open-infrastructure-dehydrated-tools/title
+db_input low open-infrastructure-dehydrated-tools/register "${REGISTER}" || true
+db_go
+
db_stop
diff --git a/debian/open-infrastructure-dehydrated-tools.postinst b/debian/open-infrastructure-dehydrated-tools.postinst
index 083c2ac..48b5d0f 100755
--- a/debian/open-infrastructure-dehydrated-tools.postinst
+++ b/debian/open-infrastructure-dehydrated-tools.postinst
@@ -66,24 +66,27 @@ case "${1}" in
db_get open-infrastructure-dehydrated-tools/contact-email
CONTACT_EMAIL="${RET}" # string (w/ empty)
+ db_get open-infrastructure-dehydrated-tools/ocsp-fetch
+ OCSP_FETCH="${RET}" # boolean
+
+ db_get open-infrastructure-dehydrated-tools/ocsp-must-staple
+ OCSP_MUST_STAPLE="${RET}" # boolean
+
db_get open-infrastructure-dehydrated-tools/hooks
HOOKS="${RET}" # multi-select (w/ empty)
db_get open-infrastructure-dehydrated-tools/basedir
NEW_BASEDIR="${RET}" # string (w/o empty)
- db_get open-infrastructure-dehydrated-tools/register
- REGISTER="${RET}" # boolean
-
- db_get open-infrastructure-dehydrated-tools/ocsp-fetch
- OCSP_FETCH="${RET}" # boolean
-
- db_get open-infrastructure-dehydrated-tools/ocsp-must-staple
- OCSP_MUST_STAPLE="${RET}" # boolean
+ db_get open-infrastructure-dehydrated-tools/domains
+ DOMAINS="${RET}" # string (w/ empty)
db_get open-infrastructure-dehydrated-tools/tsig
TSIG="${RET}" # string (w/ empty)
+ db_get open-infrastructure-dehydrated-tools/register
+ REGISTER="${RET}" # boolean
+
db_stop
case "${AUTO_CLEANUP}" in
@@ -228,11 +231,12 @@ EOF
Install "${BASEDIR}" "${NEW_BASEDIR}"
fi
- case "${REGISTER}" in
- true)
- dehydrated --register --accept-terms
- ;;
- esac
+ if [ -n "${DOMAINS}" ]
+ then
+ echo "${DOMAINS}" > /etc/dehydrated/domains.txt
+ else
+ cat /etc/hostname > /etc/dehydrated/domains.txt
+ fi
if [ -n "${TSIG}" ]
then
@@ -285,6 +289,12 @@ EOF
mv -f "${DEFAULT_FILE}.tmp" "${DEFAULT_FILE}"
fi
+
+ case "${REGISTER}" in
+ true)
+ dehydrated --register --accept-terms
+ ;;
+ esac
;;
abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/debian/open-infrastructure-dehydrated-tools.templates b/debian/open-infrastructure-dehydrated-tools.templates
index 947e5eb..ae72683 100644
--- a/debian/open-infrastructure-dehydrated-tools.templates
+++ b/debian/open-infrastructure-dehydrated-tools.templates
@@ -67,12 +67,14 @@ Default:
Description: dehydrated hooks:
Please select any hooks that should be enabled for dehydrated.
-Template: open-infrastructure-dehydrated-tools/register
-Type: boolean
-Default: false
-Description: dehydrated register:
- Should a 'dehydrated --register --accept-terms' be executed now to create
- an account for this system with your CA.
+Template: open-infrastructure-dehydrated-tools/domains
+Type: string
+Default:
+Description: dehydrated domains:
+ Please enter the domains to be configured for dehydrated.
+ .
+ If unsure, leave empty (default) which will use the hostname
+ of the system.
Template: open-infrastructure-dehydrated-tools/tsig
Type: string
@@ -83,3 +85,10 @@ Description: dehydrated TSIG:
itself (format as used by nsupdate -y in algorithm:name:base64).
.
If unsure, leave empty (default).
+
+Template: open-infrastructure-dehydrated-tools/register
+Type: boolean
+Default: false
+Description: dehydrated register:
+ Should a 'dehydrated --register --accept-terms' be executed now to create
+ an account for this system with your CA.