diff --git a/tasks/tomcat-pkgs.yml b/tasks/tomcat-pkgs.yml index fbc2864..444696e 100644 --- a/tasks/tomcat-pkgs.yml +++ b/tasks/tomcat-pkgs.yml @@ -121,10 +121,13 @@ - ansible_distribution_version is version_compare('24.04', '<') tags: ['tomcat', 'tomcat_serverxml', 'tomcat_conf', 'tomcat_init'] -- name: tomcat-pkgs | Reload the systemd daemon if we are running on a systemd-backed server - ansible.builtin.systemd: - daemon-reload: true - when: reload_systemd +- name: tomcat-pkgs | Ensure that /usr/lib/systemd/system exists + ansible.builtin.file: + path: /usr/lib/systemd/system + state: directory + owner: root + group: root + mode: "0755" tags: ['tomcat', 'tomcat_instances', 'tomcat_init'] - name: tomcat-pkgs | Install the systemd unit @@ -135,11 +138,18 @@ group: root mode: "0644" notify: tomcat restart + register: reload_systemd when: - tomcat_use_systemd_unit - ansible_distribution_version is version_compare('24.04', '<') tags: ['tomcat', 'tomcat_serverxml', 'tomcat_conf'] +- name: tomcat-pkgs | Reload the systemd daemon if we are running on a systemd-backed server + ansible.builtin.systemd: + daemon-reload: true + when: reload_systemd + tags: ['tomcat', 'tomcat_instances', 'tomcat_init'] + - name: tomcat-pkgs | Install a slightly modified catalina.properties ansible.builtin.template: src: catalina.properties.j2