Docker inventory

Similar to the OpenStack and EC2 inventory plugins detailed earlier in this book, a Docker inventory script is also available. The Docker script is located at contrib/inventory/docker.py, within the Ansible source repository, with an associated configuration file at contrib/inventory/docker.yml. To make use of this script, simply copy the .py file to the playbook directory that expects to use it, or to a path accessible to all users/playbooks on the system that will be executing Ansible. For our example, I'll copy it to the playbook directory. The configuration file, which can be used to define how to connect to one or more Docker daemons, does not need to be used for this example, as we'll simply be connecting to the local ...

Get Mastering Ansible - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.