# Ansible command module giving errors in playbook

**URL:** <https://forum.ansible.com/t/ansible-command-module-giving-errors-in-playbook/29008>\
**Category:** Ansible Project\
**Created:** [November 12, 2018, 3:05pm UTC](https://forum.ansible.com/t/ansible-command-module-giving-errors-in-playbook/29008 "2018-11-12T15:05:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vivek1](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@Vivek1](https://forum.ansible.com/u/Vivek1)\
**Post date:** [November 12, 2018, 3:05pm UTC](https://forum.ansible.com/t/ansible-command-module-giving-errors-in-playbook/29008/1 "2018-11-12T15:05:28Z")

</div>

0down vote[favorite](https://stackoverflow.com/questions/53264864/ansible-command-module-giving-errors-in-playbook#)

I am creating a playbook to silently execute a installation package using Command module. But here I am getting playbook execution error. Below is my playbook sample.

Here my aim is to execute the myibm silent package only if the specified path is not present “/opt/IBM/myibm”. But here i am not able to run this play successfully, but the local manual command execution is success. so the issue with my playbook.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 12, 2018, 3:26pm UTC](https://forum.ansible.com/t/ansible-command-module-giving-errors-in-playbook/29008/2 "2018-11-12T15:26:08Z")

</div>

Ansible uses a 'batch login' by default, which might not source the  
same files as an interactive one and not have the same PATH set, so  
either use full path for installc or use the `environement:` keyword  
to ensure the correct PATH is set.

---

<div class="post-metadata">

**Author:** ![Vivek1](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@Vivek1](https://forum.ansible.com/u/Vivek1)\
**Post date:** [November 12, 2018, 3:56pm UTC](https://forum.ansible.com/t/ansible-command-module-giving-errors-in-playbook/29008/3 "2018-11-12T15:56:05Z")

</div>

Hello Brian,

Thanks for your valuable advise, i modifed my playbook with vars as the path of the installer as below and still have the error.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 12, 2018, 4:01pm UTC](https://forum.ansible.com/t/ansible-command-module-giving-errors-in-playbook/29008/4 "2018-11-12T16:01:38Z")

</div>

That does not modify the command task, so i expect it to keep giving  
the same error.
