1

Any way to retrieve the ansible tower hostname from where i ssh/run my job?

Aka ; from a ansible fact variable ..?

I need to know the ansible tower hostname when i run a job from inventory hostname

Thanks Dominic

  • Have you try to set the gather_facts to true and get something like ansible.hostname from there? – Ardhi Dec 11 '18 at 01:37

1 Answers1

1

you can fetch that information from "execution_node" variable.

  • it wont show you in facts. Assuming if you are running it from Tower, you can debug this variable to get that information. Take a look at this to get a basic overview of what variables does ansible tower set during run time:: https://docs.ansible.com/ansible-tower/3.2.1/html/towerapi/project_update.html – Random_Automation Dec 11 '18 at 07:49
  • Ok now I see. Get this variable from api rest request! Thanks – Dominic D'Apice Dec 11 '18 at 11:52