summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2018-01-02 12:42:42 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2018-01-02 12:45:42 +0000
commitfff3bb6442861d128bbf5b12734d3a3579025890 (patch)
treeb45b2d9c2f342fcb565120c6432f570ed33ffc31
parent8b082e836f4863488965fde530752ea4402d387d (diff)
downloadinfrastructure-fff3bb6442861d128bbf5b12734d3a3579025890.tar.gz
baserock_frontend: Restart haproxy if the configuration changespedro/ssl-certs-jan-2018
-rw-r--r--README.md1
-rw-r--r--baserock_frontend/instance-config.yml11
2 files changed, 11 insertions, 1 deletions
diff --git a/README.md b/README.md
index a9d3cdcb..2d65909f 100644
--- a/README.md
+++ b/README.md
@@ -537,7 +537,6 @@ that will configure them.
For the frontend, run:
ansible-playbook -i hosts baserock_frontend/instance-config.yml
- ansible -i hosts -m service -a 'name=haproxy enabled=true state=restarted' --sudo frontend-haproxy
Which will install the certificates and then restart the services needed.
diff --git a/baserock_frontend/instance-config.yml b/baserock_frontend/instance-config.yml
index d5e79ff4..c1d3cfaf 100644
--- a/baserock_frontend/instance-config.yml
+++ b/baserock_frontend/instance-config.yml
@@ -13,8 +13,19 @@
dest: /etc/pki/tls/private/baserock.pem
owner: haproxy
mode: 400
+ notify:
+ - restart haproxy
- name: HAProxy configuration
copy:
src: haproxy.cfg
dest: /etc/haproxy/haproxy.cfg
+ notify:
+ - restart haproxy
+
+ handlers:
+ - name: restart haproxy
+ service:
+ name: haproxy
+ enabled: true
+ state: restarted