Hi, I am relatively new to Ansible and struggle to grasp how one should use dynamic inventories within playbooks or tools that call ansible-core. I have a python script that returns a valid json list of hostgroups and members which works with
ansible-inventory -i script.py -e hostgroup=webservers playbook.yml
.
Is there any way to run this dynamic inventory within a play and pass it to a second play?
The only option I see now, is to run the inventory script with cmd module and use add_host for the subsequent play.
Rgrds.