summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--roles/nginx/main.yml17
1 files changed, 17 insertions, 0 deletions
diff --git a/roles/nginx/main.yml b/roles/nginx/main.yml
index f9366fa..d0a3b98 100644
--- a/roles/nginx/main.yml
+++ b/roles/nginx/main.yml
@@ -33,6 +33,8 @@
update_cache: yes
name:
- logrotate
+ - certbot
+ - certbot-nginx
- name: Installing the required nginx dependencies
apk:
@@ -266,3 +268,18 @@
enabled: yes
with_items:
- nginx
+
+ - name: Setting up certbot automatic renewal
+ blockinfile:
+ path: /etc/periodic/daily/certbot
+ block: |
+ #!/bin/sh
+ /usr/bin/certbot renew --agree-tos
+ create: yes
+
+ - name: Making certbot executable
+ file:
+ path: /etc/periodic/daily/certbot
+ mode: '0755'
+
+