I would suggest approching it like this, though I haven't tested this and 
I'm not very experienced with docker. (If anyone has experience with this 
or knows a better solution please correct me :-) ):
1. Put your items in a separate file and define them as a dictionary.

Like this:

---

myservices:
    - { name: "service1", ports: "8080:8080" }
    - { name: "service2", ports: "8081:8080" }
    - { name: "service3", ports: "8082:8080" }


2. Now in your playbook be sure to set serial: 1, include the yml file with 
your service dict and define your tasks like this

---

- name: Start and wait for containers
  docker: name=mydata  image={{ item.name }} state=present ports={{ item.ports 
}}
  wait_for: port={{ item.wait_for_port }}
  with_items:
    - "{{myservices}}"


-- 
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/9d068297-d3d3-4493-bb57-64733e7b8340%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to