From 7be2219ea7e26fbb9e62c958a67e6f6dde0236b4 Mon Sep 17 00:00:00 2001 From: Ramon Melero Date: Sun, 2 Apr 2017 02:40:19 -0500 Subject: [PATCH] Fix haproxy-service-config tag haproxy-service-config tag was not assembling service configs before restarting haproxy. Change-Id: I840a58d5fb7cfc9f4f71924211a6c3c6e4438359 --- handlers/main.yml | 8 ++++++++ tasks/haproxy_post_install.yml | 10 +--------- tasks/haproxy_service_config.yml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) 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