Elasticsearch restart task hangs up in Ansible Playbook

101 views
Skip to first unread message

Roopendra Vishwakarma

unread,
Sep 10, 2014, 6:24:34 AM9/10/14
to ansible...@googlegroups.com
I am using ansible playbook to install elasticsearch and elasticsearch plugin. after successfully installation of Elasticsearch I written one ansible task to Restart Elasticsearch. Its restarting elasticsearch but ansible playbook hang up in this task. My ansible task is:

    - name: "Ensure Elasticsearch is Running"
      service
: name=elasticsearch state=restarted


I also tried with `shell: sudo service elasticsearch restart` but no luck.

**Elasticsearch Version** : 1.3.0 
**Ansible Version**       : 1.5.5

Verbose Output for the task is :

    <app101.host.com> ESTABLISH CONNECTION FOR USER: prod on PORT 22 TO app101.host.com
   
<app101.host.com> REMOTE_MODULE service name=elasticsearch state=restarted
   
<app101.host.com> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1410327554.04-167734794521310
       && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1410327554.04-167734794521310 && echo $HOME/.ansible/tmp/ansible-tmp-1410327554.04-167734794521310'
   
<app101.host.com> PUT /tmp/tmpjIMUkF TO /home/prod/.ansible/tmp/ansible-tmp-1410327554.04-167734794521310/service
   
<app101.host.com> EXEC /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=yeztwzmmsgyvjjqmmunnvtbopcplrbso]
      password: " -u root /bin/sh -c '"'"'echo SUDO-SUCCESS-yeztwzmmsgyvjjqmmunnvtbopcplrbso; /usr/bin/python /home/prod/.ansible/tmp/ansible-tmp-1410327554.04-167734794521310/service;
      rm -rf /home/prod/.ansible/tmp/ansible-tmp-1410327554.04-167734794521310/ >/dev/null 2>&1'"'"''

Any Suggestion?

Michael DeHaan

unread,
Sep 10, 2014, 8:30:35 AM9/10/14
to ansible...@googlegroups.com
So your ansible version is *VERY* old, which could be causing your problem.  Most likely it's a lack of a sudo password unless this is not the first task in your playbook, but it's hard to say.  

Since then, there have been two new major releases, including security updates along the way.

Can you please try this with Ansible 1.7.1, and then if you are still having problems, please confirm where your Elastic Search package came from, your OS platform that is running it?


--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5b97dddd-156f-4fd9-a012-caee4ad643aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Roopendra Vishwakarma

unread,
Sep 10, 2014, 8:36:57 AM9/10/14
to ansible...@googlegroups.com
Thanks for Quick Response. Sure I will make try with ansible 1.7.1.

We have added elasticsearch latest version in our repo and installing through yum. (yum install elasticsearch)

and I am trying this on CentOS 6.3.

Roopendra Vishwakarma

unread,
Sep 10, 2014, 9:25:59 AM9/10/14
to ansible...@googlegroups.com
I tried playbook on ansible 1.8 but problem still same.

Roopendra Vishwakarma

unread,
Sep 12, 2014, 1:39:39 AM9/12/14
to ansible...@googlegroups.com
Fix this problem.  Cause of the issue. I am using old version of service wrapper script for elasticsearch. After update  /etc/init.d/elasticsearch everything is working fine.
Reply all
Reply to author
Forward
0 new messages