sudo using local connection

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

Now, if I execute this playbook :

I have investigated a bit, and found this issue, which seems related :
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