On Wed, Sep 27, 2017 at 6:00 AM, Parth Gandhi <[email protected]> wrote:
> Hi,
> I need to pass conditional value based on the host in the same group to
> environment variable in playbook. IS there a way to do it?
> Here is the use case. I have a host file with a group having 2 servers
>
> hosts:
> [rancher]
> hostA
> hostB
>
> rancher_create.yaml:
> - hosts: xyz
>   docker_container:
>     image: xyz
>     env:
>       IP: {{ hostA_IP }}
>
> the IP environment variable should take host A ip for HostA  and hostB ip
> for HostB. Both the servers are used for same service in cluster and for
> cluster to setup there is a need to pass the individual IP to the docker
> container cmd.
>

http://docs.ansible.com/ansible/latest/intro_inventory.html#host-variables


> Thanks,
> Parth
>
> --
> 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/6509f789-02d5-4380-9a90-13dea10338be%40googlegroups.com.
> 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 [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/CAHEKYV6yy1JupLoyOVOYxGSv6GA7pnqb%2B%3DyHKq0kBs4fGR9Y8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to