# sudo using local connection

**URL:** <https://forum.ansible.com/t/sudo-using-local-connection/20823>\
**Category:** Ansible Project\
**Created:** [March 10, 2016, 10:27am UTC](https://forum.ansible.com/t/sudo-using-local-connection/20823 "2016-03-10T10:27:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephane](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@stephane](https://forum.ansible.com/u/stephane)\
**Post date:** [March 10, 2016, 10:27am UTC](https://forum.ansible.com/t/sudo-using-local-connection/20823/1 "2016-03-10T10:27:44Z")

</div>

Hello,

I’ve a problem using local connections and delegates.

Let’s take that inventory :  
[local]

local ansible\_connection=local

[remote]  
ahost ansible\_host=[ahost.example.com](http://ahost.example.com)

Now, if I execute this playbook :

---

<div class="post-metadata">

**Author:** ![stephane](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@stephane](https://forum.ansible.com/u/stephane)\
**Post date:** [March 10, 2016, 2:31pm UTC](https://forum.ansible.com/t/sudo-using-local-connection/20823/2 "2016-03-10T14:31:13Z")

</div>

I have investigated a bit, and found this issue, which seems related :  
[https://github.com/ansible/ansible/issues/14720](https://github.com/ansible/ansible/issues/14720)

But what I found is that I can use the same workaround, so this is working :

- hosts: ahost  
gather\_facts: false  
tasks:
- name: delegate to local  
file: dest=kikoolol state=touch  
delegate\_to: local

vars:  
ansible\_become: no
