I think what you want to use is the set_fact module to set variables from
your provisioning roles that you later recall when provisioning your LBs.

http://docs.ansible.com/set_fact_module.html



On Tue, Mar 25, 2014 at 4:58 AM, <mitchellgay...@gmail.com> wrote:

> Hi All,
>
> I am running a role "run_docker_containers" which creates a series of
> docker containers using the docker module.
>
> - name: Run containers
>   docker: state=present name={{ item }} ports=80 image=myimage command=
> 'blah'
>   with_sequence: start=1 end='5' format=mycontainer_%d
>
>
> The containers are created OK, and I can display the output of the module
> by using a debug statement (from the documentation examples) if I put the
> debug statement inside the role "run_docker_containers".
> - debug: msg={{inventory_hostname}}:{{item}}
>   with_items: docker_containers
>
>
> I am currently trying to pass the information returned by the docker
> module to a different role. The other role is part of setting up load
> balancing, so I am trying to get IP and port settings of the containers.
>
> I have tried using the debug statement above inside "load_balance" but
> could not get it to display any information. Here is what the output looks
> like inside the other role:
> [mytest.host] => (item=docker_containers) => {
>
>     "item": "docker_containers",
>
>     "msg": "mytest.host:docker_containers"
>
> }
>
>
> Here is what the list of roles looks like:
>
> - hosts: testhosts
>   roles:
>     - run_docker_containers
>     - load_balance
>
>
> Any ideas how I can pass the information between roles?
>
> Thanks
>
> Mitch
>
>
>  --
> 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/6b7417ab-9a90-4aab-8075-3352cc71e7be%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/6b7417ab-9a90-4aab-8075-3352cc71e7be%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAK6JQEEdOJC2tep%3DkvcD-RDHajF3iPyytGGaisorGuh06%2B8wpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to