# Error with installing elasticsearch plugins using shell or command

**URL:** <https://forum.ansible.com/t/error-with-installing-elasticsearch-plugins-using-shell-or-command/17805>\
**Category:** Ansible Project\
**Created:** [March 22, 2015, 2:43pm UTC](https://forum.ansible.com/t/error-with-installing-elasticsearch-plugins-using-shell-or-command/17805 "2015-03-22T14:43:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Levine](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@Greg\_Levine](https://forum.ansible.com/u/Greg_Levine)\
**Post date:** [March 22, 2015, 2:43pm UTC](https://forum.ansible.com/t/error-with-installing-elasticsearch-plugins-using-shell-or-command/17805/1 "2015-03-22T14:43:56Z")

</div>

I posted the following question to SO. TIA for any guidance that you may be able to provide.

[http://stackoverflow.com/questions/29190666/what-does-this-ansible-error-mean](http://stackoverflow.com/questions/29190666/what-does-this-ansible-error-mean)

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 22, 2015, 8:57pm UTC](https://forum.ansible.com/t/error-with-installing-elasticsearch-plugins-using-shell-or-command/17805/2 "2015-03-22T20:57:02Z")

</div>

That seems an elastic search error, unrelated to ansible.

---

<div class="post-metadata">

**Author:** ![Greg\_Levine](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@Greg\_Levine](https://forum.ansible.com/u/Greg_Levine)\
**Post date:** [March 23, 2015, 2:56am UTC](https://forum.ansible.com/t/error-with-installing-elasticsearch-plugins-using-shell-or-command/17805/3 "2015-03-23T02:56:17Z")

</div>

It is an elasticsearch error, but I’m not sure it’s unrelated to Ansible. Reading the elasticsearch source, it looks like elasticsearch looks for a resource to load called elasticsearch.yml. It looks in a few places, but my suspicion is that it finds this file in $PATH. So does Ansible add playbooks to $PATH?

Elasticsearch will look in the current working directory for elasticsearch.yml. However, I’m skeptical that this is the reason because I’m running a script that loads the playbooks and calls ansible-playbook on them. When I’m running my script, I’m not running it from the same directory where the playbooks are located. And my script doesn’t cd into the playbooks directory or add the playbooks directory or any playbooks to $PATH. So unless, Ansible cd’s into the playbooks directory, the $PATH scenario is more likely. It’s entirely possible, but I have my doubts that Ansible is changing directories since it doesn’t seem necessary.

---

<div class="post-metadata">

**Author:** ![Greg\_Levine](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@Greg\_Levine](https://forum.ansible.com/u/Greg_Levine)\
**Post date:** [March 23, 2015, 3:07am UTC](https://forum.ansible.com/t/error-with-installing-elasticsearch-plugins-using-shell-or-command/17805/4 "2015-03-23T03:07:06Z")

</div>

But it looks like I’m wrong. In my script, prior to calling ansible-playbooks, I’ve printed pwd. It is not the directory containing the playbooks.

In the elasticsearch playbook, I’ve captured the value of pwd and printed it using the debug module. The current directory is now the directory containing the playbooks. Ansible is changing directories.

I’m not saying this is a bug, but it certainly has the affect of unintended consequences. Sure, I can change the name of my playbook to work around it. But I have to image it’s avoidable by Ansible.

---

<div class="post-metadata">

**Author:** ![Greg\_Levine](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@Greg\_Levine](https://forum.ansible.com/u/Greg_Levine)\
**Post date:** [March 23, 2015, 2:51pm UTC](https://forum.ansible.com/t/error-with-installing-elasticsearch-plugins-using-shell-or-command/17805/5 "2015-03-23T14:51:15Z")

</div>

In case anyone comes across this post, make sure you read the SO post.

[https://stackoverflow.com/questions/29190666/what-does-this-ansible-error-mean](https://stackoverflow.com/questions/29190666/what-does-this-ansible-error-mean)

One answer is to simply change the playbook filename. But if that is not an option, you can use the chdir feature to force Ansible to move out of the playbooks dir before installing plugins.
