Hi Patrick,
Actually i don't know if it has anything to do with the "with_sequences"
clause. I have the following code
docker: name="cluster-data" hostname="{{ data_hostname }}"
image="lgueye/cluster-data" state=present
.
.
.
docker: name="cluster-index" hostname="{{ index_hostname }}"
image="lgueye/cluster-index" state=present
When I loop over the *docker_containers *dict, seeking for IP adresses, I
only get one IP adress.
I dumped the dict and It contains information only about the last running
container.
I'm just providing information, unfortunately I I'm totally unable to
provide a fix right now. Sorry.
Le mercredi 16 avril 2014 23:41:04 UTC+2, Patrick Galbraith a écrit :
>
> Hi all!
>
> I have what I think is a simple question. It pertains to what is
> visible/available in the "docker_containers" dictionary when running a run
> book.
>
> Ok, so, what’s throwing me off is whether to use one of the following:
>
> - name launch containers
>
> docker: image=df02bd73464a count={{ start_containers_count }}
>
> Or
>
> - name launch containers
>
> docker: image=df02bd73464a name=somename_{{item}}
>
> with_sequence: count={{ start_containers_count }}
>
> It is the first snippet that works for doing this next task:
>
> - name: print container info
>
> debug: msg="{{item['NetworkSettings']['IPAddress']}}"
>
> with_items: docker_containers
>
> Why? Because the latter results in “docker_containers” only having the
> last container’s information (last container launched), whereas the former
> gives me all of them.
>
>
> It’s probably something really simple…
>
--
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/3deba4c8-8a2b-42c5-ac91-a9e4db5aeb03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.