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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access