ansible-letsencrypt icon indicating copy to clipboard operation
ansible-letsencrypt copied to clipboard

Adapted for multiple certs

Open ScuttleSE opened this issue 8 years ago • 5 comments

The current one doesn't take into account if you have multiple certs. The cronjob gets overwritten every time your run the role with a new cert. Now one job is created for each cert. I also randomized the starting minute, so we don't hit a rate-limiter for some reason....

ScuttleSE avatar Aug 11 '17 06:08 ScuttleSE

Isn't this still going to create 1 cronjob total? It's just picking off the first domain name from the list instead of having a hard coded file name.

nickjj avatar Aug 11 '17 10:08 nickjj

I have my playbook like this:

- role: nginx-letsencrypt
      letsencrypt_domains: [example1.org, www.example1.org]
    - role: nginx-letsencrypt
      letsencrypt_domains: [example2.se, www.example2.se]
    - role: nginx-letsencrypt
      letsencrypt_domains: [rss.example3.org]

That creates three different cronjobs

#Ansible: renew SSL certificates for example1.org
24 0 1 * * /usr/local/acme-tiny/example1.org-renew_certificate.sh
#Ansible: renew SSL certificates for example2.se
12 0 1 * * /usr/local/acme-tiny/example2.se-renew_certificate.sh
#Ansible: renew SSL certificates for rss.example3.org
44 0 1 * * /usr/local/acme-tiny/rss.example3.org-renew_certificate.sh

ScuttleSE avatar Aug 11 '17 11:08 ScuttleSE

I see.

That's not really adapting it for multiple certificates. That's running the role more than once with a unique file name.

I thought you were going to internally create a loop in this role so this role only needs to be ran once.

nickjj avatar Aug 11 '17 11:08 nickjj

Welp, this is what I've got :)

ScuttleSE avatar Aug 11 '17 11:08 ScuttleSE

The cron job ovewrite also happends when this script is used to install certificate in multiple installations and this patch fixes it, would be relley nice to have it merged, can I do something to move forward?

pinkavaj avatar Mar 22 '19 22:03 pinkavaj