From ed0c1fddee67663b6ac79b2614b56b791f7ee5b4 Mon Sep 17 00:00:00 2001 From: Aidaho Date: Thu, 16 Jan 2025 18:00:10 +0300 Subject: [PATCH] v8.1.5: Refactor HAProxy task organization for better structure Moved HAProxy state file and stats directory creation tasks from `configure.yml` to `installation.yml` for improved logical grouping. This change ensures installation-related tasks are consolidated, enhancing maintainability and clarity. --- .../ansible/roles/haproxy/tasks/configure.yml | 17 ----------------- .../roles/haproxy/tasks/installation.yml | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/scripts/ansible/roles/haproxy/tasks/configure.yml b/app/scripts/ansible/roles/haproxy/tasks/configure.yml index 7c1f8fde..592d3178 100644 --- a/app/scripts/ansible/roles/haproxy/tasks/configure.yml +++ b/app/scripts/ansible/roles/haproxy/tasks/configure.yml @@ -61,20 +61,3 @@ dest: /etc/haproxy/haproxy.cfg mode: 0644 force: no - -- name: Copy HAProxy state file in place. - template: - src: haproxy.state.j2 - dest: /etc/haproxy/haproxy.state - owner: haproxy - group: haproxy - mode: 0644 - force: no - -- name: Creates HAProxy stats directory - file: - path: /var/lib/haproxy - owner: haproxy - group: haproxy - state: directory - ignore_errors: yes diff --git a/app/scripts/ansible/roles/haproxy/tasks/installation.yml b/app/scripts/ansible/roles/haproxy/tasks/installation.yml index 1654083e..02dae605 100644 --- a/app/scripts/ansible/roles/haproxy/tasks/installation.yml +++ b/app/scripts/ansible/roles/haproxy/tasks/installation.yml @@ -98,6 +98,23 @@ mode: 0644 when: (ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == 'CentOS') and haproxy_from_wi is defined +- name: Copy HAProxy state file in place. + template: + src: haproxy.state.j2 + dest: /etc/haproxy/haproxy.state + owner: haproxy + group: haproxy + mode: 0644 + force: no + +- name: Creates HAProxy stats directory + file: + path: /var/lib/haproxy + owner: haproxy + group: haproxy + state: directory + ignore_errors: yes + - name: Enable and start service HAProxy systemd: name: haproxy