# User performing local\_action

**URL:** <https://forum.ansible.com/t/user-performing-local-action/18224>\
**Category:** Ansible Project\
**Created:** [May 13, 2015, 5:24pm UTC](https://forum.ansible.com/t/user-performing-local-action/18224 "2015-05-13T17:24:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Oliver](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@John\_Oliver](https://forum.ansible.com/u/John_Oliver)\
**Post date:** [May 13, 2015, 5:24pm UTC](https://forum.ansible.com/t/user-performing-local-action/18224/1 "2015-05-13T17:24:35Z")

</div>

joliver@flamingo ~ $ ansible-playbook -u joliver.sa -K deploy\_checklist.yml  
SUDO password:

PLAY [aria] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [aria]

TASK: [command mkdir {{ local\_dest }}] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
failed: [aria → 127.0.0.1] =\> {“failed”: true, “parsed”: false}  
Sorry, user joliver is not allowed to execute ‘/bin/sh -c echo BECOME-SUCCESS-kurupkexxbnzqduwcxnbrwsqscbbvjzz; LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python /Users/joliver/.ansible/tmp/ansible-tmp-1431537294.93-186879714899356/command; rm -rf /Users/joliver/.ansible/tmp/ansible-tmp-1431537294.93-186879714899356/ \>/dev/null 2\>&1’ as root on flamingo.

Is there a way to perform local\_actions as the user I specify as an argument to ansible-playbook? It appears to be honoring the ‘sudo: yes’, so it stands to reason that if I’m specifying a user, that’s who I want performing all actions.

---

<div class="post-metadata">

**Author:** ![John\_Oliver](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@John\_Oliver](https://forum.ansible.com/u/John_Oliver)\
**Post date:** [May 13, 2015, 5:26pm UTC](https://forum.ansible.com/t/user-performing-local-action/18224/2 "2015-05-13T17:26:30Z")

</div>

I did sort of get around this by passing ‘sudo: no’ to that one task.

---

<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:** [May 13, 2015, 5:35pm UTC](https://forum.ansible.com/t/user-performing-local-action/18224/3 "2015-05-13T17:35:28Z")

</div>

-u is remote\_user which does not map to local actions which are  
normally executed as the user which executed ansible, since local  
action does not 'log in' the only other was to change the user would  
be using privilege escalation (sudo/su/etc).
