Execute with no changes if cert exists

What’s the preferred way to execute letsencrypt-auto in an idempotent manner? I’m trying to provision a server with Ansible, but when this command runs, now that I finally have a certificate in place, it fails because the certificate is already in place.

A couple of questions for testing purposes:

  1. Is it safe to simply delete the certs in /etc/letsencrypt/live/my-domain?
  2. If I delete them will that cue the script to install them again or is there something else in play that would create an error condition?
  3. What can I add to the command just to nothing (or at least not thrown an error) if I run the command multiple times? --renew?

Thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.