Exit with separate failure if in DNS manual mode

In our environment we use DNS manual mode and take the TXT record
output of acme.sh and process it with Ansible to install the records
(then we call renew later when the records have been pushed to the DNS
servers by a whole bunch of other bits).

One problem is that after getting/showing the TXT records, acme.sh
always returns 1.  This makes it difficult to tell if there is
actually an error condition.

Since we have set the manual-mode flag, not installing the DNS records
is an expected correct result.  This returns a separate error code for
this situation (3), which can be distinguished in automation.
This commit is contained in:
Ian Wienand 2019-11-27 12:06:02 +11:00
parent 7746042adc
commit be7840c827

View File

@ -4764,7 +4764,13 @@ $_authorizations_map"
_err "Please add the TXT records to the domains, and re-run with --renew."
_on_issue_err "$_post_hook"
_clearup
return 1
if [ -n "$FORCE_DNS_MANUAL" ]; then
# If asked to be in manual DNS mode, flag this exit with a separate
# error so it can be distinguished from other failures.
return 3
else
return 1
fi
fi
fi