Skip to content

Commit

Permalink
Fix a configuration placement problem and add a notify on changed files.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdebock committed Jan 31, 2019
1 parent 4180b17 commit 0f721d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 2 additions & 4 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
- name: systemctl daemon-reload
systemd:
daemon_reload: yes
notify:
- restart tomcat

- name: restart tomcat
- name: restart tomcat instance
service:
name: tomcat
name: "{{ instance_name }}"
state: restarted
10 changes: 9 additions & 1 deletion tasks/instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,25 @@
until: install_tomcat is succeeded
retries: 3

- name: save instance name
set_fact:
instance_name: "{{ instance.name }}"

- name: configure tomcat instance - server.xml
template:
src: server.xml.j2
dest: "{{ tomcat_directory }}/{{ instance.name }}/server.xml"
dest: "{{ tomcat_directory }}/{{ instance.name }}/conf/server.xml"
notify:
- restart tomcat instance

- name: configure tomcat instance - setenv.sh
template:
src: setenv.sh.j2
dest: "{{ tomcat_directory }}/{{ instance.name }}/bin/setenv.sh"
when:
- instance.java_opts is defined
notify:
- restart tomcat instance

- name: register tomcat instance to sysvinit
template:
Expand Down

0 comments on commit 0f721d7

Please sign in to comment.