From 1a4923a6acb49230a94db410278777c0ed818552 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 31 Jul 2024 15:50:46 +0200 Subject: [PATCH] Fix the distribution version check --- defaults/main.yml | 2 +- tasks/tomcat-pkgs.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index f73c9e8..bb17205 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 %}" diff --git a/tasks/tomcat-pkgs.yml b/tasks/tomcat-pkgs.yml index 0be3ca4..b1223db 100644 --- a/tasks/tomcat-pkgs.yml +++ b/tasks/tomcat-pkgs.yml @@ -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