AWX - Create dynamic inventory from python script

Hi,

I use an AWX instance [23.7.0] with static inventory.

I developped a python script to create a dynamic inventory.
The return is in YAML and works fine (Datasource from an API).

But now i want to create an inventory generated by exectued the python script.

Do you kno how can i do that ?

Thanks for your help,

Matt

I would start here:

In the end it comes down to 2 choices:

  • turn it into an ‘inventory script’. It requires specific structure of JSON output.
  • or turn it into an ‘inventory plugin’, no direct output, you now update the inventory objects directly, then use ansible-inventory to see the results.