Skip to content
Snippets Groups Projects
README.md 860 B

Ansible Inventory Generator Overview

This project aims to automate the generation of Ansible inventory files by pulling data from the WFO API.

Features

Generate Ansible inventory from WFO API.
Save processed data to appropriate inventory file(s).
Ensure no alteration to existing inventory files in case of process failure.

Once installed, you can use the ansible_inventory_generator command to generate the Ansible inventory from the API:

pip install \
    --pre \
    --extra-index-url https://artifactory.software.geant.org/artifactory/api/pypi/geant-swd-pypi/simple \
    ansible-inventory-generator
    
export api_url=http://127.0.0.1:8080/api/v1/subscriptions/routers
export host_vars_dir=/path/to/base/hostvars/dir
export vars_file_name=wfo_vars.yaml
export hosts_file_dir=/path/to/base/hosts/dir

ansible_inventory_generator