summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-02-16 12:11:45 +0200
committerLars Wirzenius <liw@liw.fi>2019-02-16 12:11:45 +0200
commitd886a8c389a11c931b091747649e44c61c484f0d (patch)
treec3ab1729cf743a0991ec19495c3c99191e9e2650 /roles
parentc8dfd26fe8731a3839439a8d4b8545eca34ffab8 (diff)
downloaddebian-ansible-d886a8c389a11c931b091747649e44c61c484f0d.tar.gz
Refactor: install daily cron job, then invoke it, instead of inline
Diffstat (limited to 'roles')
-rw-r--r--roles/haproxy/tasks/main.yml28
1 files changed, 14 insertions, 14 deletions
diff --git a/roles/haproxy/tasks/main.yml b/roles/haproxy/tasks/main.yml
index b80f2c4..4a9b717 100644
--- a/roles/haproxy/tasks/main.yml
+++ b/roles/haproxy/tasks/main.yml
@@ -21,6 +21,19 @@
name: certbot
default_release: stretch-backports
+- name: "install daily cron job to create haproxy.pem"
+ copy:
+ content: |
+ #!/bin/sh
+ set -eu
+ cd /etc/letsencrypt/live/haproxy
+ cat fullchain.pem privkey.pem > /etc/ssl/haproxy.pem
+ systemctl restart haproxy
+ dest: /etc/cron.daily/haproxy.pem
+ owner: root
+ group: root
+ mode: 0755
+
- name: "run certbot"
shell: |
set -eu
@@ -35,20 +48,7 @@
--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
-
-- name: "install daily cron job to create haproxy.pem"
- copy:
- content: |
- #!/bin/sh
- cd /etc/letsencrypt/live/haproxy
- cat fullchain.pem privkey.pem > /etc/ssl/haproxy.pem
- systemctl restart haproxy
- dest: /etc/cron.daily/haproxy.pem
- owner: root
- group: root
- mode: 0755
+ /etc/cron.daily/haproxy.pem
- name: install haproxy
apt: