docker module introduced breaking change in v 1.8

With v1.8 the format of the env parameter is changed from list to dict.

The change was done after a bug report re the following (ansible/ansible#8199):

env="PG_ROLE=master,
PG_PORT=5432,
PG_ENABLE_ARCHIVING=1,
PG_ENABLE_WALE=1,
about 20 more..."

However, this could have been solved without the breaking change, just by using the list format in a normal way
Note that the examples in the module should be updated

env:
- PG_ROLE=master
- PG_PORT=5432
- PG_ENABLE_ARCHIVING=1
- PG_ENABLE_WALE=1
- about 20 more...

(this is a format I am currently using and is wrking fine)

This changes makes it impossible to reuse a playbook (and perhaps roles) between a <1.8 and >=1.8 environment.

I agree that a dict is to be preferred over a list, but the list was already defined. For such a minor version bump, I would not expect such a not-backward compatible change

see ansible/ansible#8199 / and ansible/ansible-modules-core/issues/197.

Hans

Send us a pull request if you would like us to consider, but Docker’s API is very unstable.

We are probably only going to support the latest version of the API and probably add some version checks to what we think the minimum docker-py/docker versions are, and we still can’t be responsible for the changes in new versions breaking old things.

However, we’ll update things as quickly as we can.

Docker users may be increasingly interested in running the development branch to consume the latest.