set the tomcat version at runtime. See https://support.d4science.org/issues/16551

This commit is contained in:
Andrea Dell'Amico 2019-04-19 18:50:34 +02:00
parent 19b37c6d4c
commit f12038b2f1
2 changed files with 26 additions and 1 deletions

View File

@ -1,5 +1,8 @@
---
tomcat_version: 7
# The tomcat version is set at runtime. It changes from one distribution to the other.
#tomcat_version: 7
# To force a tomcat version set the following variable:
# tomcat_fixed_version: 9
tomcat_pkg_state: present
tomcat_service_enabled: True
tomcat_pkgs:

View File

@ -1,4 +1,26 @@
---
- name: Set the tomcat version for ubuntu Trusy
set_fact:
tomcat_version: 7
when:
- ansible_distribution_major_version <= '16'
- tomcat_fixed_version is not defined
tags: tomcat
- name: Set the tomcat version for Ubuntu bionic
set_fact:
tomcat_version: 8
when:
- ansible_distribution_major_version == '18'
- tomcat_fixed_version is not defined
tags: tomcat
- name: Impose a tomcat version
set_fact:
tomcat_version: '{{ tomcat_fixed_version }}'
when: tomcat_fixed_version is defined
tags: tomcat
- name: Install the tomcat packages
apt: pkg={{ tomcat_pkgs }} state={{ tomcat_pkg_state }}
tags: tomcat