Skip to content

A Django application that can be used as dynamic Ansible inventory

License

Notifications You must be signed in to change notification settings

infodot-be/django-ansible-inventory

Repository files navigation

django-ansible-inventory

Build Status

This django project will create an REST API server for dynamic inventory for Ansible. The Ansible inventory can dynamically query this REST API during playbook execution.

The object Manipulation is done via REST API directly or the ipam-cli interface.

All objects are case sensitive in the current version.

The inventory.py script available in the scripts directory will retrieve the information and format it for Ansible

[]$ ansible-inventory -i inventory.py --list
{
    "Master": {
        "hosts": [
            "obiwan.example.com",
            "yoda.example.com"
        ]
    },
    "Padawan": {
        "hosts": [
            "anakin.example.com",
            "luke.example.com"
        ]
    },
    "_meta": {
        "hostvars": {
            "anakin.example.com": {},
            "luke.example.com": {},
            "obiwan.example.com": {},
            "yoda.example.com": {}
        }
    },
    "all": {
        "children": [
            "Master",
            "Padawan",
            "ungrouped"
        ]
    }
}

About

A Django application that can be used as dynamic Ansible inventory

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages