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