Fix the distribution version check

This commit is contained in:
Andrea Dell'Amico 2024-07-31 15:50:46 +02:00
parent 2d4a27d216
commit 1a4923a6ac
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@
# tomcat_fixed_version: 9
tomcat_pkg_state: present
tomcat_service_enabled: true
tomcat_use_systemd_unit: "{% if ansible_distribution_major_version is version_compare('18.04', '>=') %}true{{ tomcat_version }}{% else %}false{% endif %}"
tomcat_use_systemd_unit: "{% if ansible_distribution_version is version_compare('18.04', '>=') %}true{{ tomcat_version }}{% else %}false{% endif %}"
tomcat_systemd_security_enhanced: false
tomcat_systemd_security: "{% if tomcat_systemd_security_enhanced %}true{% else %}false{% endif %}"

View File

@ -3,7 +3,7 @@
ansible.builtin.set_fact:
tomcat_version: 7
when:
- ansible_distribution_major_version is version_compare('16.04', '<')
- ansible_distribution_version is version_compare('16.04', '<')
- tomcat_fixed_version is not defined
tags: ['tomcat', 'tomcat_ver', 'tomcat_conf', 'tomcat_javamelody']
@ -11,7 +11,7 @@
ansible.builtin.set_fact:
tomcat_version: 8
when:
- ansible_distribution_major_version is version_compare('18.04', '==')
- ansible_distribution_version is version_compare('18.04', '==')
- tomcat_fixed_version is not defined
tags: ['tomcat', 'tomcat_ver', 'tomcat_conf', 'tomcat_javamelody']
@ -19,7 +19,7 @@
ansible.builtin.set_fact:
tomcat_version: 10
when:
- ansible_distribution_major_version is version_compare('24.04', '==')
- ansible_distribution_version is version_compare('24.04', '==')
- tomcat_fixed_version is not defined
tags: ['tomcat', 'tomcat_ver', 'tomcat_conf', 'tomcat_javamelody']
@ -112,7 +112,7 @@
notify: tomcat restart
when:
- tomcat_use_systemd_unit
- ansible_distribution_major_version is version_compare('24.04', '<')
- ansible_distribution_version is version_compare('24.04', '<')
tags: ['tomcat', 'tomcat_serverxml', 'tomcat_conf']
- name: tomcat-pkgs | Install the systemd unit
@ -125,7 +125,7 @@
notify: tomcat restart
when:
- tomcat_use_systemd_unit
- ansible_distribution_major_version is version_compare('24.04', '<')
- ansible_distribution_version is version_compare('24.04', '<')
tags: ['tomcat', 'tomcat_serverxml', 'tomcat_conf']
- name: tomcat-pkgs | Install a slightly modified catalina.properties