Ansible’s docker module depends on docker-py (Python bindings for the Docker API), and docker-py just pushed a minor-version update bump that contains some changes that break the docker module in Ansible as it is. I’d be happy to push fixes to support this but before I do, I had a few questions:
Is this something we even want? The changes are pretty trivial, but it’ll be tricky to make it completely transparent which version of docker-py we’re working with, as newer versions of the Docker API return different info about each container than older versions do.
How do we deal with backwards-compatibility between versions? Right now there doesn’t seem to be a really good way to tell what version of docker-py we’re working with, which complicates things (I do have a super-simple PR for docker-py open for that here: https://github.com/dotcloud/docker-py/pull/168).
Is https://github.com/ansible/ansible/pull/5639 going to be reviewed/merged in the near-ish future? If it were, it would be a little easier to base future changes off that PR rather than trying to merge later I’d guess.
Thanks in advance! Let me know if you have any questions.
So, to better understand the backwards incompatibility, is it due to upgrading the default API version to 1.8 from 1.6?
If so, I think that should be pretty easy to handle, by setting version=“1.6” in the docker.client.Client instantiation.
Ideally however, specifying a newer API would improve things, since there are some “inconsistencies” with the 1.6 API.
Maybe we can create a “map” of what different return keys mean for different docker API versions, which could allow us to map the responses from docker-py to a standard output? This could even enable us to make the API version a configurable attribute for the modules.
So, to better understand the backwards incompatibility, is it due to upgrading the default API version to 1.8 from 1.6?
If so, I think that should be pretty easy to handle, by setting version=“1.6” in the docker.client.Client instantiation.
There are (easy-to-fix, so far, but still breaking) incompatibilities in the actual Python bindings as well as changes in returned data from API versions.
Setting version="1.6" could help with getting consistent data returned, but that alone won’t make Ansible’s docker module work with 0.3.0.