# Cannot execute a command on remote machine

**URL:** <https://forum.ansible.com/t/cannot-execute-a-command-on-remote-machine/24522>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [May 19, 2017, 12:04pm UTC](https://forum.ansible.com/t/cannot-execute-a-command-on-remote-machine/24522 "2017-05-19T12:04:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [May 19, 2017, 12:04pm UTC](https://forum.ansible.com/t/cannot-execute-a-command-on-remote-machine/24522/1 "2017-05-19T12:04:14Z")

</div>

It looks like your command depends on some environment vars.  
Can you try the shell module instead of command?  
That should handle it better.

Dick
