Delegation - Multiple and Parallel

880 views
Skip to first unread message

Abhishek R.

unread,
Jan 26, 2016, 2:21:11 PM1/26/16
to Ansible Project
Hi,

For plays, the "hosts" element accepts multiple hosts separated by colon. That is,

hosts: "host1:host2:host3"

- works. However, within a task, when delegating to other hosts, the same pattern does not seem to work. That is,

delegate_to: "host1:host2:host3"

- doesn't appear to work. I get a "ControlPath too long" error, possibly because ansible is interpreting the concatenated hosts as a single host.

So, how do can a task be delegated to multiple hosts and run on them in parallel?

Any insight into this is appreciated.

Regards

Brian Coca

unread,
Jan 28, 2016, 5:35:03 PM1/28/16
to Ansible Project
you can delegate to multiple hosts, but not run them in paralell

- task:
delegate_to: "{{item}}"
with_items:
- host1
- host2
- host3
> --
> 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 ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/cfdb5e18-8b20-40a6-8c73-80dbfc1be52b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Brian Coca
Reply all
Reply to author
Forward
0 new messages