performing a local task on every (remote) loop iteration - is that even possible?

26 views
Skip to first unread message

nusenu

unread,
Nov 17, 2015, 5:22:53 PM11/17/15
to Ansible Project
Hi,

I'm wondering whether the following is possible with ansible only or not.

I've got a role that (besides other tasks) creates folders on remote
hosts for every available IP address/port combination [1].

What I would need now is to perform a local task on the ansible host for
every item/iteration of that loop.

Example:

playbook runs against 2 hosts:

hostA
1.1.1.1
80
443
2.2.2.2
80
443

hostB
3.3.3.3
80
4.4.4.4
80

In the end I'd like to have the following folders created on the host
running ansible:

1.1.1.1_80
1.1.1.1_443
2.2.2.2_80
2.2.2.2_443
3.3.3.3_80
4.4.4.4_80

Is that possible?

thanks,
nusenu


[1]
https://github.com/nusenu/ansible-relayor/blob/master/tasks/configure.yml#L3

nusenu

unread,
Nov 18, 2015, 12:52:50 PM11/18/15
to ansible...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages