I have a template which gets executed in the instance group.
This instance group consist of 4 servers and when the template is executed, the job can be assigned on any of the server attached to the instance group.
Lets say these servers as server-A, server-B, server-C, server-D
As part of my template execution, i need to display the hostname where the job is being executed.
Is there a way to expose the details of the server where the job is being executed?
I’m not quite sure since I have not been using AWX much lately., but by referencing awx_execution_node in the playbook, we might be able to obtain the hostname.
To test, i created a simple playbook like below and executed from AWX with the instance group containing 4 servers (execution nodes). I got the desired output.
name: Display the AWX execution node
hosts: localhost
tasks:
name: Print the execution node name
debug:
msg: “This job is being executed on: {{ awx_execution_node }}”