# Issue with local\_action

**URL:** <https://forum.ansible.com/t/issue-with-local-action/20058>\
**Category:** Ansible Project\
**Created:** [December 22, 2015, 12:51am UTC](https://forum.ansible.com/t/issue-with-local-action/20058 "2015-12-22T00:51:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Talerico](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@Joe\_Talerico](https://forum.ansible.com/u/Joe_Talerico)\
**Post date:** [December 22, 2015, 12:51am UTC](https://forum.ansible.com/t/issue-with-local-action/20058/1 "2015-12-22T00:51:51Z")

</div>

Executing a local\_action, and i expect it to execute as the user running the playbook, however it attempts to sudo…

- hosts: all  
gather\_facts: False  
become: false  
sudo: false  
name: Generating bug report  
tasks:
- local\_action: template src=templates/bug\_report.j2 dest=./bug\_report.log owner=jtaleric group=jtaleric  
sudo: false

Error:

TASK: [template src=templates/bug\_report.j2 dest=./bug\_report.log owner=jtaleric group=jtaleric] \*\*\*  
failed: [overcloud-controller-0 → 127.0.0.1] =\> {“failed”: true, “parsed”: false}  
[sudo via ansible, key=jrpmqdghzaqcxctggogqzeqwlackuxoy] password:

failed: [[lorenzo.perf.lab.eng.rdu.redhat.com](http://lorenzo.perf.lab.eng.rdu.redhat.com) → 127.0.0.1] =\> {“failed”: true, “parsed”: false}  
[sudo via ansible, key=iwyxhshbicbckjvtxnfmlgpduzzserun] password:

failed: [overcloud-controller-1 → 127.0.0.1] =\> {“failed”: true, “parsed”: false}  
[sudo via ansible, key=ouyroitfajmptfpdcetwqjqeuggtkazi] password:

failed: [overcloud-novacompute-1 → 127.0.0.1] =\> {“failed”: true, “parsed”: false}  
[sudo via ansible, key=dnobuxrlxocbicinbadxiclumyldpvfp] password:

failed: [overcloud-novacompute-0 → 127.0.0.1] =\> {“failed”: true, “parsed”: false}  
[sudo via ansible, key=zuihnfjzyuvjulfqovgeuihkiixkvpfi] password:

failed: [overcloud-controller-2 → 127.0.0.1] =\> {“failed”: true, “parsed”: false}  
[sudo via ansible, key=qpsiaqkjjbpxmssbnopfreokldbfooyn] password:

Any thoughts?

---

<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:** [December 22, 2015, 2:15am UTC](https://forum.ansible.com/t/issue-with-local-action/20058/2 "2015-12-22T02:15:23Z")

</div>

You should not need to set become/sudo to false (also they are  
redundant) unless you are setting it elsewhere to do so. If set  
through the command line, ansible.cfg or environment variables.

If you set the inventory vars 'ansible\_become/ansible\_sudo', these  
would override the directives, to avoid this you should set them at  
the play level which will obey normal variable precedence.
