From e2d1d33f0f21369cb66b6d2622ed7d602a937de6 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 1 Aug 2024 14:36:57 +0200 Subject: [PATCH] Reload systemd after installing the tomcat unit. --- tasks/tomcat-pkgs.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasks/tomcat-pkgs.yml b/tasks/tomcat-pkgs.yml index f6ce38e..9751e08 100644 --- a/tasks/tomcat-pkgs.yml +++ b/tasks/tomcat-pkgs.yml @@ -110,15 +110,22 @@ group: root mode: "0755" 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 the systemd unit ansible.builtin.template: src: tomcat-service.j2 - dest: "/etc/systemd/system/tomcat{{ tomcat_version }}" + dest: "/usr/lib/systemd/system/tomcat{{ tomcat_version }}.service" owner: root group: root mode: "0644"