From 3609982b4cc3fdf9a5afcc3dcf5c08ab1c44c4cb Mon Sep 17 00:00:00 2001 From: genofire Date: Sat, 3 Oct 2020 03:14:01 +0200 Subject: [PATCH] Enable HAProxy service --- roles/haproxy/tasks/main.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/roles/haproxy/tasks/main.yml b/roles/haproxy/tasks/main.yml index e90b346..c2b81ae 100644 --- a/roles/haproxy/tasks/main.yml +++ b/roles/haproxy/tasks/main.yml @@ -180,3 +180,19 @@ - name: Flush handlers meta: flush_handlers + +- name: Start HAProxy + command: fdmove -c 2 1 s6-rc -u -v 2 change haproxy + register: change + changed_when: change.stdout | length > 0 + +- name: Enable HAProxy + lineinfile: + path: /etc/s6-rc/service/enabled/contents + regexp: "^haproxy$" + line: "haproxy" + notify: + - Reload s6-rc + +- name: Flush handlers (again) + meta: flush_handlers