diff --git a/tasks/RedHat.yaml b/tasks/RedHat.yaml index 2f06865..10d13d0 100644 --- a/tasks/RedHat.yaml +++ b/tasks/RedHat.yaml @@ -14,12 +14,6 @@ verbosity: 2 when: haproxy_installed_package is defined -- name: Mask HAProxy before install - ansible.builtin.systemd: - name: "{{ haproxy_unit_name }}" - masked: yes - when: haproxy_package_name not in ansible_facts.packages or ansible_facts.packages[haproxy_package_name][0]['version'] != (haproxy_version|string + "-" + haproxy_version_build|string) - - name: "Install {{ haproxy_package_name }}-{{ haproxy_version }}-{{ haproxy_version_build }}" dnf: name: "{{ haproxy_package }}" @@ -35,7 +29,7 @@ notify: Restart HAProxy when: - haproxy_package_name in ansible_facts.packages - - ansible_facts.packages[haproxy_package_name][0]['version'] != (haproxy_version|string + "-" + haproxy_version_build|string) + - (ansible_facts.packages[haproxy_package_name][0]['version'] + ".el{{ ansible_distribution_major_version }}") != (haproxy_version|string + "-" + haproxy_version_build|string) - name: Install python2-cryptography package: @@ -141,4 +135,5 @@ state: started enabled: yes daemon_reload: yes + masked: no register: haproxy_enable_and_start diff --git a/vars/RedHat-8.yaml b/vars/RedHat-8.yaml index 3890bde..e04ca10 100644 --- a/vars/RedHat-8.yaml +++ b/vars/RedHat-8.yaml @@ -1,6 +1,6 @@ haproxy_package_name: "haproxy" haproxy_version: "1.8.27" -haproxy_version_build: "5" +haproxy_version_build: "5.el{{ ansible_distribution_major_version }}" haproxy_package: "{{ haproxy_package_name }}-{{ haproxy_version }}-{{ haproxy_version_build }}" haproxy_package_name_regex: "{{ haproxy_package_name }}-{{ haproxy_version }}-{{ haproxy_version_build }}" haproxy_unit_name: "{{ haproxy_package_name }}" diff --git a/vars/RedHat-9.yaml b/vars/RedHat-9.yaml index 283a78e..8c3fc58 100644 --- a/vars/RedHat-9.yaml +++ b/vars/RedHat-9.yaml @@ -1,6 +1,6 @@ haproxy_package_name: "haproxy" haproxy_version: "2.4.17" -haproxy_version_build: "3" +haproxy_version_build: "3.el{{ ansible_distribution_major_version }}" haproxy_package: "{{ haproxy_package_name }}-{{ haproxy_version }}-{{ haproxy_version_build }}" haproxy_package_name_regex: "{{ haproxy_package_name }}-{{ haproxy_version }}-{{ haproxy_version_build }}" haproxy_unit_name: "{{ haproxy_package_name }}"