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 }}"*

     

*- name: "Event Logs for AIRID={{ AIR }} ENVIRONMENT={{ ENVI }}"  command: 
some command here*

What i get in the result for task name is:
*TASK [Event Logs for AIRID={{ AIR }} ENVIRONMENT={{ ENVI }}]*

I have even tried set_fact task before this task but that too doesn't work. 
Can anyone suggest how can i get the host variables in task name?


*PS: Please ignore the indentation, this maybe because of formatting change 
in the post. *

-- 
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/6eb4aa96-1156-4a37-b2d8-c527572ffd1fn%40googlegroups.com.

Reply via email to