diff --git a/tasks/main.yml b/tasks/main.yml index d80e8e5..ec5cd67 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -260,7 +260,7 @@ - name: Install the instances systemd unit ansible.builtin.template: src: tomcat-service.j2 - dest: "/etc/systemd/system//tomcat-instance-{{ item.http_port }}" + dest: "/usr/lib/systemd/system/tomcat-instance-{{ item.http_port }}" mode: "0644" owner: root group: root @@ -270,6 +270,14 @@ notify: tomcat multiple-instances restart tags: ['tomcat', 'tomcat_instances', 'tomcat_init'] +- name: Reload the systemd daemon if we are running on a systemd-backed server + ansible.builtin.systemd: + daemon-reload: true + when: + - ansible_service_mgr == 'systemd' + - tomcat_use_systemd_unit + tags: ['tomcat', 'tomcat_instances', 'tomcat_init'] + - name: Install the helper script used by the systemd unit ansible.builtin.template: src: tomcat-start.sh.j2 @@ -293,13 +301,6 @@ notify: tomcat multiple-instances restart tags: ['tomcat', 'tomcat_instances', 'tomcat_conf', 'tomcat_default', 'jdk'] -- name: Reload the systemd daemon if we are running on a systemd-backed server - ansible.builtin.systemd: - daemon-reload: true - when: - - ansible_service_mgr == 'systemd' - - tomcat_use_systemd_unit - - name: Install a custom context.xml file ansible.builtin.template: src: tomcat-context.xml.j2