Hi Michael,
Quoting also did not work. I added "sh" before the {{ and it worked.
tasks:
- name: stop tomcat
shell: sh {{ tomcat_home }}/bin/shutdown.sh
- name: start tomcat
shell: sh {{ tomcat_home }}/bin/startup.sh
Thanks for the link.
Regards,
Olga
On Thursday, October 9, 2014 1:33:15 AM UTC+5:30, Michael Peters wrote:
>
> Try quoting the templated part. The {{ }} syntax markers mess up the
> yaml parsing - http://docs.ansible.com/YAMLSyntax.html#gotchas
>
> On Wed, Oct 8, 2014 at 3:41 PM, olga <[email protected] <javascript:>>
> 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] <javascript:>.
> > To post to this group, send email to [email protected]
> <javascript:>.
> > 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/7cc0daa5-8d6e-46d8-ba2b-1f35ff8acdc8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.