docker inspect inside an Ansible task with a Go template
This has bugged me on and off for a little while and I've finally found a way that works. Here's an example:
- command: >
docker inspect -f \{\{' 'index' '.NetworkSettings.Ports' '\"8080/tcp\"' '0' '\"HostPort\"\}\} jenkins
register: port