diff --git a/defaults/main.yml b/defaults/main.yml index 13167bb..730b98c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,6 +11,7 @@ haproxy_install: [] haproxy_restart_handler_state: restarted haproxy_conf_template: "etc/haproxy/haproxy.cfg.j2" +haproxy_conf_loc: "/etc/haproxy/haproxy.cfg" # global section haproxy_global_log: diff --git a/tasks/configuration.yml b/tasks/configuration.yml index b827132..e930412 100644 --- a/tasks/configuration.yml +++ b/tasks/configuration.yml @@ -3,11 +3,11 @@ - name: configuration | update file template: src: "{{ haproxy_conf_template }}" - dest: /etc/haproxy/haproxy.cfg + dest: "{{ haproxy_conf_loc }}" owner: root group: root mode: 0640 - validate: 'haproxy -f %s -c' + validate: "haproxy -f %s -c {{ haproxy_conf_loc }}" notify: restart haproxy tags: - haproxy-configuration-update-file