diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-08-07 18:48:25 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-08-07 18:48:25 +0300 |
commit | fc12b854b1ed1b9e9d1c890998c1e294269c6a58 (patch) | |
tree | e62ac1684fdb22c550c314fbb47a9e24a8aaa387 /roles | |
parent | 24eaa6c48c7147f2f7330bcb1ad4677208714403 (diff) | |
download | debian-ansible-fc12b854b1ed1b9e9d1c890998c1e294269c6a58.tar.gz |
Add: check that letsencrypt_email is set
Diffstat (limited to 'roles')
-rw-r--r-- | roles/haproxy/tasks/main.yml | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/roles/haproxy/tasks/main.yml b/roles/haproxy/tasks/main.yml index 0a56410..a7854fb 100644 --- a/roles/haproxy/tasks/main.yml +++ b/roles/haproxy/tasks/main.yml @@ -7,6 +7,15 @@ ;; esac +- name: "check letsencrypt_email is set" + shell: | + case "{{ letsencrypt_email }}" in + FIXME) + echo "ERROR: MUST set letsencrypt_email" 1>&2 + exit 1 + ;; + esac + - name: "install certbot" apt: name: certbot @@ -14,6 +23,7 @@ - name: "run certbot" shell: | + set -eu certbot certonly \ --standalone \ --noninteractive \ @@ -22,8 +32,8 @@ --expand \ --cert-name haproxy \ --keep \ - --pre-hook "systemctl stop haproxy" \ - --post-hook "systemctl start haproxy" \ + --pre-hook "systemctl stop apache2 haproxy" \ + --post-hook "systemctl start apache2 haproxy" \ -d "{{ haproxy_domain }}" (cd /etc/letsencrypt/live/haproxy; cat fullchain.pem privkey.pem) \ > /etc/ssl/haproxy.pem |