I believe what you are attempting should work.  But you seem to be missing
reference to the "set_fact" module in the second task.
 "some-moudle-that-sets-vars" is the "set_fact" module, and should do what
you want.


On Thu, Jun 19, 2014 at 11:35 AM, Vasco Figueira <vasco.figue...@gmail.com>
wrote:

> Hi all,
>
> I don't seem to find a way to do the following, which probably means I'm
> trying to do it in some weird way.
>
> ---
> # tasks/main.yml
> - name: check docker socket existence
>   stat: path=/var/run/docker.sock
>   register: docker_socket
>
> - name: set docker_url based on socket existence
>   some-module-that-sets-vars:
>     docker_url: "{% if not docker_socket.stat.exists %}
> http://127.0.0.1:4243 {% else %}unix://var/run/docker.sock {% endif %}"
>
> Help?
>
> Thanks a bunch.
>
> Yours,
>
> Vasco
>
> --
> 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/dec888eb-856f-4eaf-b3a3-2fb281d5644a%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/dec888eb-856f-4eaf-b3a3-2fb281d5644a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
m...@sivel.net
http://sivel.net/

-- 
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/CAD8N0v9EByv53shujzrN3BHvD7%3D%2BZz9cgTJaMQqiFySgM%2Bwa5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to