Hi,
---
- hosts: service
vars:
app_service_port: 8080
tomcat_home: /opt/apache-tomcat-8.0.9
remote_user: deploy
tasks:
- name: stop tomcat
shell: {{ tomcat_home }}/bin/shutdown.sh
- name: start tomcat
shell: {{ tomcat_home }}/bin/startup.sh
When i run this play, i get
ERROR: Syntax Error while loading YAML script, test.yml
Note: The error may actually appear before this position: line 8, column 28
tasks:
- shell: {{ tomcat_home}}/bin/shutdown.sh
is variable substitution not allowed in shell module.
These are custom installed tomcat dir, so i have to use shell command to start and stop the tomcat. Also, has anyone verified if the java process got killed. I have seen some times that after shutdown, the java process still run. OR is there any easy method in ansible to do this.
Thanks,
olaga