diff --git a/handlers/main.yml b/handlers/main.yml index 27eff9d..71db31a 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -18,6 +18,14 @@ cat {{ haproxy_ssl_cert }} {{ haproxy_user_ssl_ca_cert is defined | ternary(haproxy_ssl_ca_cert,'') }} {{ haproxy_ssl_key }} > {{ haproxy_ssl_pem }} notify: Restart haproxy +- name: Regenerate haproxy configuration + assemble: + src: "/etc/haproxy/conf.d" + dest: "/etc/haproxy/haproxy.cfg" + notify: Restart haproxy + tags: + - haproxy-general-config + - name: Restart haproxy service: name: "haproxy" diff --git a/tasks/haproxy_post_install.yml b/tasks/haproxy_post_install.yml index 7accd81..ad5ba08 100644 --- a/tasks/haproxy_post_install.yml +++ b/tasks/haproxy_post_install.yml @@ -43,17 +43,9 @@ tags: - haproxy-service-config -- name: Regenerate haproxy configuration - assemble: - src: "/etc/haproxy/conf.d" - dest: "/etc/haproxy/haproxy.cfg" - notify: Restart haproxy - tags: - - haproxy-general-config - - name: Enable haproxy services service: name: "haproxy" enabled: "yes" tags: - - haproxy-enable-service-config \ No newline at end of file + - haproxy-enable-service-config diff --git a/tasks/haproxy_service_config.yml b/tasks/haproxy_service_config.yml index 3e7a1ee..5b07b98 100644 --- a/tasks/haproxy_service_config.yml +++ b/tasks/haproxy_service_config.yml @@ -24,7 +24,7 @@ (item.service.haproxy_backup_nodes is defined and item.service.haproxy_backup_nodes | length > 0) - item.service.haproxy_service_enabled | default('True') | bool - notify: Restart haproxy + notify: Regenerate haproxy configuration tags: - haproxy-service-config