/usr/lib/systemd/system does not exist on Ubuntu 18.04.

This commit is contained in:
Andrea Dell'Amico 2024-08-02 13:27:31 +02:00
parent 8570d5ff5b
commit 1a3c99b5eb
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 13 additions and 2 deletions

View File

@ -257,10 +257,21 @@
when: tomcat_use_systemd_unit
tags: ['tomcat', 'tomcat_instances', 'tomcat_init']
- name: Check if /usr/lib/systemd/system exists
ansible.builtin.stat:
path: /usr/lib/systemd/system
register: systemd_system_path
tags: ['tomcat', 'tomcat_instances', 'tomcat_init']
- name: Define the installation path of the systemd unit
ansible.builtin.set_fact:
systemd_unit_dest_dir: '{% if systemd_system_path.stat.exists %}/usr/lib/systemd/system{% else %}/etc/systemd/system{% endif %}'
tags: ['tomcat', 'tomcat_instances', 'tomcat_init']
- name: Install the instances systemd unit
ansible.builtin.template:
src: tomcat-service.j2
dest: "/usr/lib/systemd/system/tomcat-instance-{{ item.http_port }}.service"
dest: "{{ systemd_unit_dest_dir }}/tomcat-instance-{{ item.http_port }}.service"
mode: "0644"
owner: root
group: root

View File

@ -124,7 +124,7 @@ org.apache.catalina.startup.ContextConfig.jarsToSkip=
# Additional JARs (over and above the default JARs listed above) to skip when
# scanning for TLDs. The list must be a comma separated list of JAR file names.
org.apache.catalina.startup.TldConfig.jarsToSkip=tomcat7-websocket.jar
org.apache.catalina.startup.TldConfig.jarsToSkip=tomcat-websocket.jar
#
# String cache configuration.