# Executing python script through ansible keeps saying that Permission denied even though become: yes is specified

**URL:** <https://forum.ansible.com/t/executing-python-script-through-ansible-keeps-saying-that-permission-denied-even-though-become-yes-is-specified/22602>\
**Category:** Ansible Project\
**Created:** [September 21, 2016, 2:31pm UTC](https://forum.ansible.com/t/executing-python-script-through-ansible-keeps-saying-that-permission-denied-even-though-become-yes-is-specified/22602 "2016-09-21T14:31:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Grossman](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@Robert\_Grossman](https://forum.ansible.com/u/Robert_Grossman)\
**Post date:** [September 21, 2016, 2:31pm UTC](https://forum.ansible.com/t/executing-python-script-through-ansible-keeps-saying-that-permission-denied-even-though-become-yes-is-specified/22602/1 "2016-09-21T14:31:55Z")

</div>

Hi,

I am new to ansible and I have been trying to execute a python script through a task. I have tried the command, script, and shell modules, but ansible is unable to execute this script. If I try using the command module, ansible says that the script is not there even though when I ssh into the machine and use the same command, it works. I doubt that this is a permissions issue since I am using become: yes to tell ansible to execute this script as sudo. When I try to execute this script with the script and shell modules, the task fails saying that permission was denied. I have tried using become and become\_user, but I still get this error message. Any suggestions?

Thanks!

---

<div class="post-metadata">

**Author:** ![Andrew\_Feller](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@Andrew\_Feller](https://forum.ansible.com/u/Andrew_Feller)\
**Post date:** [September 22, 2016, 12:48pm UTC](https://forum.ansible.com/t/executing-python-script-through-ansible-keeps-saying-that-permission-denied-even-though-become-yes-is-specified/22602/2 "2016-09-22T12:48:11Z")

</div>

Not sure if it's your problem but one thing that gets people is [http://docs.ansible.com/ansible/become.html#can-t-limit-escalation-to-certain-commands](http://docs.ansible.com/ansible/become.html#can-t-limit-escalation-to-certain-commands) :

Privilege escalation permissions have to be general. Ansible does not always use a specific command to do something but runs modules (code) from a temporary file name which changes every time. If you have ‘/sbin/service’ or ‘/bin/chmod’ as the allowed commands this will fail with ansible as those paths won’t match with the temporary file that ansible creates to run the module.
