I currently run my playbooks via
# ansible-playbook -i myscript.py myplaybook.yaml
where myscript.py
generates the relevant host information (per the documentation) and myplaybook.py
starts with
---
- hosts: all
(...)
This works fine.
I now would like to
- receive the inventory via a web service: include within the playbook a call to the web service and receive the inventory in the appropriate format, whatever it is (I control the web service)
- as well as make use of this inventory directly within the playbook, without the
-i
parameter, having thehost: all
directive understand that it is supposed to use it.
Is this something which is possible in ansible? I am under the impression that the inventory is needed at the start of the playbook (= that it cannot be generated within the playbook)