Hello all,

I have group tgt-cluster includes 3 hosts. I have written down role to 
deploy container which is executing on tgt-cluster group. I am controlling 
the number of containers to deploy with with_sequence. My tasks looks like 
this.

- name: Deploy Container 
  docker_container:
    name: "C{{ item }}"
    image: "{{ image_name }}:{{ image_tag }}"
    recreate: yes
    detach: yes
    tty: yes
    interactive: yes
  with_sequence: count="{{ number_of_container_to_deploy }}" 

If I want to deploy one container, currently playbook is executing on all 3 
> hosts in tgt-clustergroup and I end up with 3 containers. So How should I 
> created nested loop in this case to control the task execution on hosts on 
> round robin fashion.

Say if we want to deploy 4 container.. 1st container should be deployed on 
1st host in group, 2nd container should be deployed on 2nd host in group, 
3rd should be deployed on 3rd hosts in group and 4th container should be 
deployed back to the 1st host in group.

Need your help on this,

Thanks,

Tejas

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/94049513-df9a-4b5f-8a21-99297d70b4b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to