Closed kevinmeasom closed 2 years ago
I ended up creating my own ansible playbooks to setup an existing droplet on Ubuntu. I used ansible-playbooks repo as a starting point and adapted for my own needs.
For SSL certs I used the following tasks in my ansible playbook (obviously you would need to create your own variables).
- name: Certbot SSL
command: certbot --nginx -n -d {{ http_host }} -m {{ letsencrypt_email }} --agree-tos
when: (env == "production") and http_prot == "https"
notify: Reload Nginx
tags: [ ssl ]
- name: Add letsencrypt cronjob for cert renewal
cron:
name: letsencrypt_renewal
special_time: weekly
job: certbot renew --post-hook "systemctl reload nginx"
when: (env == "production") and http_prot == "https"
notify: Reload Nginx
tags: [ ssl ]
Hopefully that points someone else in the right direction.
I realize that this is intended for local development which is working great! What is the recommended method of deploying to a live droplet on DigitalOcean. My challenge is to make that process as seamless as possible.