# Ansible Command Module Error

**URL:** <https://forum.ansible.com/t/ansible-command-module-error/23972>\
**Category:** Ansible Project\
**Created:** [March 14, 2017, 7:18pm UTC](https://forum.ansible.com/t/ansible-command-module-error/23972 "2017-03-14T19:18:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shyam\_Yenna](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Shyam\_Yenna](https://forum.ansible.com/u/Shyam_Yenna)\
**Post date:** [March 14, 2017, 7:18pm UTC](https://forum.ansible.com/t/ansible-command-module-error/23972/1 "2017-03-14T19:18:36Z")

</div>

I am encountering issues while trying to execute below task in a playbook.

- name: Setup OpenDJ  
command: “setup --cli --propertiesFilePath /tmp/opendjsetup.props --no-prompt”  
args:  
chdir: “{{ install\_dir }}/opendj”

# creates: “{{ install\_dir }}/opendj/config”

ignore\_errors: yes

where install\_dir=/opt

Error i am encountering is below. Any help is really appreciated.

 ![](https://us1.discourse-cdn.com/ansible/original/2X/c/c845bd229a71c899feb8fd49387fde89f4b17da8.png)

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [March 14, 2017, 7:34pm UTC](https://forum.ansible.com/t/ansible-command-module-error/23972/2 "2017-03-14T19:34:51Z")

</div>

Command module can't find setup, in PATH.  
I guess you are trying to run the setup command in /opt/opendj ?  
In that case add it should be commad: "{{ install\_dir }}/opendj/setup ........

---

<div class="post-metadata">

**Author:** ![Shyam\_Yenna](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Shyam\_Yenna](https://forum.ansible.com/u/Shyam_Yenna)\
**Post date:** [March 14, 2017, 8:37pm UTC](https://forum.ansible.com/t/ansible-command-module-error/23972/3 "2017-03-14T20:37:46Z")

</div>

I have tried that one but no luck. Still it throws different error

“changed”: true,  
“cmd”: [  
“/opt/opendj/setup”,  
“–cli”,  
“–propertiesFilePath”,  
“/tmp/opendjsetup.props”,  
“–no-prompt”  
],  
“delta”: “0:00:02.185983”,  
“end”: “2017-03-14 20:27:04.226508”,  
“failed”: true,  
“invocation”: {  
“module\_args”: {  
“\_raw\_params”: “/opt/opendj/setup --cli --propertiesFilePath /tmp/opendjsetup.props --no-prompt”,  
“\_uses\_shell”: false,  
“chdir”: “/opt/opendj”,  
“creates”: null,  
“executable”: null,  
“removes”: null,  
“warn”: true  
},  
“module\_name”: “command”  
},  
“rc”: 7,  
“start”: “2017-03-14 20:27:02.040525”,  
“stderr”: “”,  
“stdout”: “”,  
“stdout\_lines”: ,  
“warnings”:   
}
