On 07.03.2019 18:18, Amir Al-Shourbaji wrote:
> I want this module to run locally on a host i delegate_to
> 
>      - name: Add Host to dhcp config
>        local_action:
>          module: lineinfile
>          dest: /etc/dhcp/dhcpd.conf
>          line: "host {{ inventory_hostname}} {hardware ethernet {{
> macaddress }};fixed-address {{ inventory_hostname}}; }"
>        notify: restart dhcpd
>        delegate_to: anarbitraryhost
> 
> Doesn't seem to work - are local_action and delegate_to mutually exclusive?

local_action is the same as delegate_to: localhost.
So you can't use them together since it gives no meaning, either you want it to 
run on localhost or anarbitraryhost.

If you want to run in on both you need two tasks.


-- 
Kai Stian Olstad

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3ef00c0e-2257-4e68-c34c-38554b21b2aa%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to