I'm trying to run two simple tasks
Task A
starts an Ipref3 server and waits for a client to connect
Task B
starts to run from host-1 until the given timeout
once Task B (host-1)
is over another Task B
run from host-2
Task B
starts to run from host-2 until the given timeout
What is a good approach to orchestrating this use-case?
This is what I tried
Task B
runs the client from multiple hosts (host-1, host-2, ..)
- name: Run iperf3 client
win_command: iperf3 -c {{ iperf_server }} -t {{ iperf_time }}
args:
chdir: "{{ iperf_dest }}"
register: iperf3_out
- debug:
var: iperf3_out.stdout
Task A
run the server
- name: Start iperf3 server
shell: iperf3 --server
async: "{{ iperf_async }}" # iperf_async = iperf_time + 10
poll: "{{ iperf_poll }}" # iperf_poll = 0
Is there a way to know when to confirm Task A
is finished before I move to the next task.
NOTE: Order of execution is important Server (Task A
) needs to run before the client (Task B
)