fix for RedHat

This commit is contained in:
ace 2023-05-13 01:20:17 +03:00
parent 15a1cd0cb4
commit 52b089fd4b
Signed by: ace
GPG Key ID: 2C08973DD37A76FD
3 changed files with 4 additions and 9 deletions

View File

@ -14,12 +14,6 @@
verbosity: 2 verbosity: 2
when: haproxy_installed_package is defined 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 }}" - name: "Install {{ haproxy_package_name }}-{{ haproxy_version }}-{{ haproxy_version_build }}"
dnf: dnf:
name: "{{ haproxy_package }}" name: "{{ haproxy_package }}"
@ -35,7 +29,7 @@
notify: Restart HAProxy notify: Restart HAProxy
when: when:
- haproxy_package_name in ansible_facts.packages - 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 - name: Install python2-cryptography
package: package:
@ -141,4 +135,5 @@
state: started state: started
enabled: yes enabled: yes
daemon_reload: yes daemon_reload: yes
masked: no
register: haproxy_enable_and_start register: haproxy_enable_and_start

View File

@ -1,6 +1,6 @@
haproxy_package_name: "haproxy" haproxy_package_name: "haproxy"
haproxy_version: "1.8.27" 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: "{{ haproxy_package_name }}-{{ haproxy_version }}-{{ haproxy_version_build }}"
haproxy_package_name_regex: "{{ 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 }}" haproxy_unit_name: "{{ haproxy_package_name }}"

View File

@ -1,6 +1,6 @@
haproxy_package_name: "haproxy" haproxy_package_name: "haproxy"
haproxy_version: "2.4.17" 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: "{{ haproxy_package_name }}-{{ haproxy_version }}-{{ haproxy_version_build }}"
haproxy_package_name_regex: "{{ 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 }}" haproxy_unit_name: "{{ haproxy_package_name }}"