Dynamic inventory and run ansible playbook in python script

Hi all
I need help to create dynamic inventory and run playbook using python script if anyone knows please help me out

Thanks
Prajwal

You may want to take a look at https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html

I find virtualbox (https://github.com/ansible-collections/community.general/blob/main/plugins/inventory/virtualbox.py) inventory plugin easiest one to understand.

Hi,

In addition to previously share documentation link, I would also recommend this video by Jeff Geerling about dynamic inventories here https://youtu.be/_rDzMYp-fBs

Hi
thanks for the study meterials