I got a small task I'd like to implement in ansible:

There is a list of websites that are on the webserver, each associated with docroot, like this:

  • site1.com => docroot: /var/www/site1/
  • site2.com => docroot: /var/www/site2/
  • site2.net => docroot: /var/www/site2/

there are also some http-redirects tpo keep one address as main:

  • www.site1.com -> site1.com
  • www.site2.com -> site2.com
  • www.site2.net -> site2.com

I need to issue Let's Encrypt's certs for these sites but I need to issue it per site, not per each domain:

  1. cert1 will be for "site1.com, www.site1.com"
  2. cert2 will be for "site2.com, www.site2.com, site2.net, www.site2.net"

I just can't figure out how I can do that in ansible: to group domain names per docroot and per site so to issue certs for domains in groups at once.

P.S. Yes I understand I can issue certs per domains but I have a lot of 3rd-level domains on my site lists (and I won't issue wildcards for security reason), and LE do rate-limits so I won't run into limits any time in the future (it is 50 certs per registered domain per week, and maybe one day I might hit the limit).

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.