Hello,

Thanks for your response. Sadly, it didn't work.

*Regards,*
*Ankit*


On Fri, Oct 9, 2020 at 9:24 PM Dick Visser <[email protected]> wrote:

> On Fri, 9 Oct 2020 at 17:34, Ankit <[email protected]> wrote:
> >
> > Hello Everyone,
> >
> > I am trying to use the host variables set for each host of inventory in
> the task name but for some reason, it doesn't work.
> >
> > I have got a dynamic inventory (hosts imported in AWX using it) and all
> the hosts have got their own variables updated based on the information
> available from source. There are 2 variables in the task name which i want
> to use in such a way that they are updated every time a task runs for each
> host of inventory. Ex variable for one of the host:
> >
> > AID: 1234
> > Environment: Staging
> >
> > What i have been trying:
> >
> > - hosts: all
> >   vars:
> >      AIR: "{{ hostvars.AIRID }}"
> >      ENVI: "{{ hostvars.Environment }}"
>
> Try this:
>
>    vars:
>       AIR: "{{ AIRID }}"
>       ENVI: "{{ Environment }}"
>
>
> > PS: Please ignore the indentation, this maybe because of formatting
> change in the post.
>
> Use plain text instead - no formatting issues there.
>
>
> DIck
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwOM4LiodObHWKZx9ZWi5u5jp-c9GWB2suabMy-mEvSx6g%40mail.gmail.com
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACecUhvtWAhyMndrkx_TBkNV78A9hdtE7rYAKEKKa4rcB%3DCoWQ%40mail.gmail.com.

Reply via email to