Browse Source

update to official debian certbot package in debian 10, backport in 9. old method of installation is deprecated.

Thomas Buck 2 years ago
parent
commit
14b36151de

+ 6
- 0
README.md View File

@@ -149,3 +149,9 @@ The same goes for the RSpamD web interface on port 11334.
149 149
 To access the gitea admin CLI, execute it like this:
150 150
 
151 151
     sudo -u git /usr/local/bin/gitea admin create-user --admin --config /etc/gitea/app.ini --name USERNAME --password PASSWORD --email MAIL
152
+
153
+To re-new the LetsEncrypt certificates, for example after adding a new role that needs another subdomain, call:
154
+
155
+    sudo certbot -c /etc/letsencrypt/cli.conf --cert-name DOMAIN
156
+
157
+Then re-run the whole sovereign playbook, or at least the letsencrypt part of it.

+ 1
- 1
roles/sslletsencrypt/files/etc_cron-daily_letsencrypt-renew View File

@@ -5,6 +5,6 @@ set -o errexit
5 5
 
6 6
 # Renew all live certificates with LetsEncrypt.  This needs to run at least
7 7
 # once every three months, but recommended frequency is once a day.
8
-/root/letsencrypt/letsencrypt-auto renew -q -c /etc/letsencrypt/cli.conf \
8
+certbot renew -q -c /etc/letsencrypt/cli.conf \
9 9
 --pre-hook="find /etc/letsencrypt/prerenew/ -maxdepth 1 -type f -executable -exec {} \;" \
10 10
 --post-hook="find /etc/letsencrypt/postrenew/ -maxdepth 1 -type f -executable -exec {} \;"

+ 1
- 1
roles/sslletsencrypt/files/letsencrypt-gencert View File

@@ -33,5 +33,5 @@ done
33 33
 # webserver, so we need to temporarily free up the HTTP(S) ports by stopping
34 34
 # our own Apache.
35 35
 service apache2 stop
36
-/root/letsencrypt/letsencrypt-auto certonly -c /etc/letsencrypt/cli.conf --domains $d
36
+certbot certonly --standalone -c /etc/letsencrypt/cli.conf --domains $d
37 37
 service apache2 start

+ 22
- 10
roles/sslletsencrypt/tasks/letsencrypt.yml View File

@@ -3,11 +3,28 @@
3 3
     name: ssl-cert
4 4
     state: present
5 5
 
6
-- name: Download LetsEncrypt release
7
-  git: repo=https://github.com/letsencrypt/letsencrypt
8
-       dest=/root/letsencrypt
9
-       version=master
10
-       force=yes
6
+- name: add stretch-backport for Certbot
7
+  apt_repository: repo='deb http://deb.debian.org/debian stretch-backports main' state=present update_cache=yes
8
+  tags:
9
+    - dependencies
10
+  when: ansible_distribution_version == '9'
11
+
12
+- name: Install Certbot
13
+  apt:
14
+    name: "certbot"
15
+    state: present
16
+    default_release: stretch-backports
17
+  tags:
18
+    - dependencies
19
+  when: ansible_distribution_version == '9'
20
+
21
+- name: Install Certbot
22
+  apt:
23
+    name: "certbot"
24
+    state: present
25
+  tags:
26
+    - dependencies
27
+  when: ansible_distribution_version == '10'
11 28
 
12 29
 - name: Create directory for LetsEncrypt configuration and certificates
13 30
   file: state=directory path=/etc/letsencrypt group=root owner=root
@@ -19,11 +36,6 @@
19 36
     owner=root
20 37
     group=root
21 38
 
22
-- name: Install LetsEncrypt package dependencies
23
-  command: /root/letsencrypt/letsencrypt-auto --help
24
-  register: le_deps_result
25
-  changed_when: "'Bootstrapping dependencies' in le_deps_result.stdout"
26
-
27 39
 - name: Create directory for pre-renewal scripts
28 40
   file: state=directory path=/etc/letsencrypt/prerenew group=root owner=root
29 41
 

+ 0
- 1
roles/sslletsencrypt/tasks/main.yml View File

@@ -1,5 +1,4 @@
1 1
 ---
2
-
3 2
 - include: ssl.yml tags=ssl
4 3
 - include: letsencrypt.yml tags=letsencrypt
5 4
 - include: ufw.yml tags=ufw

+ 4
- 0
roles/sslletsencrypt/templates/etc_letsencrypt_cli.conf.j2 View File

@@ -6,3 +6,7 @@ keep = True
6 6
 expand = True
7 7
 agree-tos = True
8 8
 non-interactive = True
9
+
10
+# Because we are using logrotate for greater flexibility, disable the
11
+# internal certbot logrotation.
12
+max-log-backups = 0

Loading…
Cancel
Save