diff --git a/ansible/roles/tomcat/tasks/main.yml b/ansible/roles/tomcat/tasks/main.yml index 984a05b5..2aa8f12c 100644 --- a/ansible/roles/tomcat/tasks/main.yml +++ b/ansible/roles/tomcat/tasks/main.yml @@ -27,8 +27,9 @@ mode: "{{ item.mode }}" owner: "{{ tomcat_owner }}" group: "{{ tomcat_group }}" - # If the files already exist, don't clobber them - force: false + # Preserve existing user-managed files, except setenv.sh: its JVM + # hostname must be refreshed when the inventory/configuration changes. + force: "{{ item.force | default(false) }}" with_items: - src: tomcat/conf name: context.xml @@ -42,6 +43,7 @@ name: setenv.sh mode: u=rwx,g=rx,o=rx dest: "{{ catalina_base }}/bin" + force: true - src: tomcat/conf name: web.xml mode: u=rw,g=r,o=r