Skip to content

inhumantsar/python-docker-dynamic-inventory

Repository files navigation

Docker Dynamic Inventory

image

image

Documentation Status

Generates a dynamic inventory of Docker containers for Ansible.

Features

  • Able to filter out a single host by name.
  • Optionally includes Docker metadata in Ansible's hostvars.
  • Optionally pretty-prints output for readability.
  • Operates on the local Docker instance by default but can work with a remote host as well.
  • Can be used as a Python module (if you really want to)

Usage

Usage: docker-dynamic-inventory [OPTIONS]

Dynamic inventories of Docker containers, served up fresh just for
Ansible.

Options:
  --host TEXT                 Only match containers with this name.
  --metadata / --no-metadata  Include container metadata.
  --pretty / --ugly           Pretty print JSON for output.
  --docker_tls TEXT           Use TLS for Docker connections.
  --docker_host TEXT          Docker host to connect to.
  --help                      Show this message and exit.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

About

Python module + CLI which produces an Ansible-compatible inventory from the Docker containers running on a host.

Resources

License

Stars

Watchers

Forks

Packages

No packages published