Hello everyone,
I have a playbook which I check a lots of parameters of many systems and next I would like to send result of playbook to CSV file. When I used Ansible in console mode, I send result of playbook to file via stream and next I used Python script to parse playbook result to CSV file for example:
ansible-playbook my_playbook.yml >> result_file
python my_parse_script.py result_file
In AWX I could do my_playbook.yml in one template and next get result_file from completed job to parse script and that is work. But it will be my everydays raport from systems status and I need automation this task.
I would like used AWX to automation but I don’t know how send result of one job to another template. My idea is launch template (playbook) in another and save result files in local path on system or network path via NFS or antother. Part of my script is:
tasks:
-
name: Check Systems
shell: ‘ansible-playbook /tmp/my_playbook.yml > /tmp/result_file’ -
name: Parse result file
shell: ‘phyton /tmp/my_parse_script.py /tmp/result_file’
That is work, but when AWX do Check Systems task, I receive information that Inventory is empty. So, my question is: How can I used Inventory from AWX in playbook inside another playbook? Or how can I join my_playbook.yml result with parse to csv result file in one template in AWX?
Thank you,
Michał