Pls help… need to collect all the hostnames in an array and pass that are art finally to an python script as an argument…so that I can process that python file with all hostname in a loop.
If any other way to doing it that would be certainly great…
Thank Dick…Thank you for your kindness…
Sorry if I confused. My intention is to run the playbook and get all the hostnames in a variable .
Like :
var=hostvars[ansible_hostname][‘ansible_hostname’]
With the above command I can fetch the hostname but how to append all the hostnames in an array so that finally I can pass that array to python script.
Thank you Abhijeet…
Actually I ve to add one role which can create an excel to automate with the hostnames in it…
so what I thought to gather all the hostnames and process them using a python script to update the excel and send the excel in mail.