Ansible Inventory Server is an easily extensible lightweight server which can create dynamic Ansible Inventories from Juju and MaaS data sources.
- Rest API for creating dynamic Ansible inventories from MaaS or Juju data sources.
- Inventory scripts for Ansible and AWX (
scripts/
) - Rest API for retrieving machine information for MaaS and Juju machines
Extended documentation for the API can be found at API.md
You can deploy the server using docker-compose with:
$ cd docker
$ docker-compose up -d
The server should be available at localhost:5000
.
The following steps are required for creating a dynamic AWX inventory for Juju machines:
- Under tab
Credential Types
, create a new type of credentials. ChooseJuju Credentials
as name. Use this Input Configuration and this Injector Configuration. Save the new credentials type. - Under
Resources/Credentials
, create new credentials of typeJuju Credentials
. Fill in with the information of your Juju deployment. - Under
Resources/Inventory Scripts
create a new inventory script, and in theCustom Script
section paste the contents of the inventory script. - Optionally, edit the script file to suit your specific deployment needs.
- Under
Resources/Inventories
create a new Inventory. - Open the new inventory, go to the
Sources
tab, and click add. ChooseCustom Script
as inventory source type. Choose your inventory script, and include the Juju Credentials you created on the second step. - Save configuration, then click Refresh. You should be seeing your Juju machines appearing under your Inventory.
You are now able to use this inventory with your Ansible Playbooks.
The process for MaaS machines is the same. Simply use the appropriate MaaS files instead.