angstwad/docker.ubuntu

Docker version is no longer a number, cause execution failed

linfan opened this issue · 2 comments

Role execution failed with below message:

TASK [docker.ubuntu : Clean previous docker-py package if installing docker.] ******
fatal: [10.124.29.81]: FAILED! => {"failed": true, "msg": "The conditional check '(_pip_install_docker or pip_install_docker_compose) and _pip_docker_package_name == 'docker'' failed. The error was: {{ 'docker-py' if _pip_version_docker | version_compare('1.10.6', '<=') else 'docker' }}: Version comparison: '<' not supported between instances of 'str' and 'int'\n\nThe error appears to have been in '/Users/flin/Workspace/tw-ms-kata/petstore-pipeline/ansible/roles/docker.ubuntu/tasks/main.yml': line 179, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n# See vars/main.yml for more information on this.\n- name: Clean previous docker-py package if installing docker.\n  ^ here\n"}

The exact issue is Version comparison: '<' not supported between instances of 'str' and 'int', it may because in the latest docker, version number is no longer a number, but a string e.g. "17.05.1-ce", which is not comparable.

I think this is a problem that needs to be resolved in Ansible, not here. At any rate, Python 2 is the right distro to use until they fix it.