User performing local_action

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.

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

-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).