Try quoting the templated part. The {{ }} syntax markers mess up the
yaml parsing - http://docs.ansible.com/YAMLSyntax.html#gotchasOn Wed, Oct 8, 2014 at 3:41 PM, olga <[email protected]> wrote: > 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 > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/72a6af6d-d972-4747-bb6f-21eb0c63350b%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJQqANdwvcCOFwyMJfJceZwVsm7KoRR2M_4YtjAADnfFxsa2ww%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
