|
@@ -16,6 +16,11 @@
|
16
|
16
|
|
17
|
17
|
- name: Install LetsEncrypt package dependencies
|
18
|
18
|
command: /root/letsencrypt/letsencrypt-auto --help
|
|
19
|
+ register: le_deps_result
|
|
20
|
+ changed_when: "'Bootstrapping dependencies' in le_deps_result.stdout"
|
|
21
|
+
|
|
22
|
+- name: Create directory for post-renewal scripts
|
|
23
|
+ file: state=directory path=/etc/letsencrypt/postrenew group=root owner=root
|
19
|
24
|
|
20
|
25
|
- name: Install crontab entry for LetsEncrypt
|
21
|
26
|
copy:
|
|
@@ -28,13 +33,8 @@
|
28
|
33
|
- name: Create live directory for LetsEncrypt cron job
|
29
|
34
|
file: state=directory path=/etc/letsencrypt/live group=root owner=root
|
30
|
35
|
|
31
|
|
-- name: Stop Apache
|
32
|
|
- service: name=apache2 state=stopped
|
33
|
|
-
|
34
|
36
|
- name: Get an SSL certificate for {{ domain }} from Let's Encrypt
|
35
|
|
- script: letsencrypt-gencert {{ domain }}
|
36
|
|
- args:
|
37
|
|
- creates: /etc/letsencrypt/live/{{ domain }}/privkey.pem
|
|
37
|
+ script: letsencrypt-gencert {{ domain }} creates=/etc/letsencrypt/live/{{ domain }}/privkey.pem
|
38
|
38
|
when: ansible_ssh_user != "vagrant"
|
39
|
39
|
|
40
|
40
|
- name: Modify permissions to allow ssl-cert group access
|
|
@@ -83,6 +83,3 @@
|
83
|
83
|
when: ansible_ssh_user == "vagrant"
|
84
|
84
|
|
85
|
85
|
### Back to normal
|
86
|
|
-
|
87
|
|
-- name: Start Apache
|
88
|
|
- service: name=apache2 state=started
|