nginx/tasks/install-Debian-letsencrypt.yml

45 lines
975 B
YAML
Raw Normal View History

2020-05-28 09:41:32 +02:00
---
- name: Install Nginx and dependencies
apt:
pkg: "{{item}}"
state: latest
update_cache: yes
with_items:
- certbot
2020-05-28 10:31:53 +02:00
tags:
- letsencrypt
2020-05-28 09:41:32 +02:00
- name: Get let's encrypt cert
2021-04-15 17:31:39 +02:00
shell: "curl https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem https://letsencrypt.org/certs/lets-encrypt-x4-cross-signed.pem > /etc/nginx/ssl/private/letsencrypt-certs.pem"
2020-05-28 10:31:53 +02:00
tags:
- letsencrypt
2020-05-28 09:41:32 +02:00
- name: Creates a cron file under /etc/cron.d
cron:
name: cerbot-renew
weekday: 1
minute: 30
hour: 2
user: root
2021-05-24 21:08:27 +02:00
job: "certbot renew >/dev/null 2>&1"
2020-05-28 10:31:53 +02:00
tags:
- letsencrypt
2020-05-28 09:41:32 +02:00
- name: Creates a cron file under /etc/cron.d
cron:
name: Reload server
weekday: 1
2020-08-03 09:08:49 +02:00
minute: 00
hour: 9
2020-05-28 09:41:32 +02:00
user: root
2021-05-24 21:08:27 +02:00
job: "/bin/systemctl reload nginx >/dev/null 2>&1"
2020-05-28 10:31:53 +02:00
tags:
- letsencrypt
2021-04-15 17:39:19 +02:00
- name: "Add Dryusdan's configuration"
file:
path: "/etc/nginx/conf.d/ssl_letsencrypt.conf"
state: absent
tags:
- letsencrypt