This is kind of a two-part feature request because they'd integrate together.
PROPOSED ADDITIONS:
- New Environment Variable:
CERTBOT_TOTAL_DOMAINS
This environment variable would contain the subject domain for each successfully renewed certificate in a comma-separated list. This would only be available to the endrun
hook(s) (see below).
- New Hook Type:
endrun
This would offer a hook type that is run once at the end of all renewals (e.g. after all validations, certificate successes, etc.).
POSSIBLE USE CASES:
This allows for avoiding multiple restarts/reloads for services that may use many certificates, for example, rather than running after each successful renewal (e.g. deploy hooks). If there are numerous separate certificates on one server and a deploy hook takes several seconds (e.g. a slowly restarting service), this can create a lot of "service flapping". The CERTBOT_TOTAL_DOMAINS variable (see above) would allow for determining whether this service uses a certificate that was renewed or not (and thus needing a restart/reload or not)..