{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2154","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2154/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2154/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2154/events","html_url":"https://github.com/ansible/ansible-modules-core/pull/2154","id":108295652,"number":2154,"title":"Fix compatibility issues of docker module with docker clients < 1.19 and docker-py < 0.5.3","user":{"login":"v0lk3r","id":971646,"avatar_url":"https://avatars.githubusercontent.com/u/971646?v=3","gravatar_id":"","url":"https://api.github.com/users/v0lk3r","html_url":"https://github.com/v0lk3r","followers_url":"https://api.github.com/users/v0lk3r/followers","following_url":"https://api.github.com/users/v0lk3r/following{/other_user}","gists_url":"https://api.github.com/users/v0lk3r/gists{/gist_id}","starred_url":"https://api.github.com/users/v0lk3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/v0lk3r/subscriptions","organizations_url":"https://api.github.com/users/v0lk3r/orgs","repos_url":"https://api.github.com/users/v0lk3r/repos","events_url":"https://api.github.com/users/v0lk3r/events{/privacy}","received_events_url":"https://api.github.com/users/v0lk3r/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bugfix_pull_request","name":"bugfix_pull_request","color":"ded270"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/cloud","name":"cloud","color":"c7def8"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/community_review","name":"community_review","color":"fad8c7"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P3","name":"P3","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-25T09:52:36Z","updated_at":"2015-10-15T18:55:28Z","closed_at":"2015-10-15T18:55:28Z","pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/pulls/2154","html_url":"https://github.com/ansible/ansible-modules-core/pull/2154","diff_url":"https://github.com/ansible/ansible-modules-core/pull/2154.diff","patch_url":"https://github.com/ansible/ansible-modules-core/pull/2154.patch"},"body":"Deploying a docker container with the following playbook-snippet fails:\r\n\r\n```yaml\r\n- name: Deploy Docker container\r\n  sudo: True\r\n  docker:\r\n    registry: \"http://private-docker-registry\"\r\n    insecure_registry: yes\r\n    docker_api_version: 1.17\r\n    pull: always\r\n    state: running\r\n    image: \"private-docker-registry/IMAGE_NAME\" \r\n    name: CONTAINER_NAME\r\n```\r\n\r\nError:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/volker/.ansible/tmp/ansible-tmp-1443173773.77-177469793583468/docker\", line 3489, in <module>\r\n    main()\r\n  File \"/home/volker/.ansible/tmp/ansible-tmp-1443173773.77-177469793583468/docker\", line 1712, in main\r\n    started(manager, containers, count, name)\r\n  File \"/home/volker/.ansible/tmp/ansible-tmp-1443173773.77-177469793583468/docker\", line 1559, in started\r\n    created = manager.create_containers(delta)\r\n  File \"/home/volker/.ansible/tmp/ansible-tmp-1443173773.77-177469793583468/docker\", line 1434, in create_containers\r\n    params['host_config']['Memory'] = mem_limit\r\nKeyError: 'host_config'\r\n\r\n```\r\n\r\nThe problem is that the current docker modules fails at detecting api_version 1.17. This is fixed with 2026fe34ddf959c35ea42c8235ef5ee274423311\r\n\r\n\r\n----\r\n\r\nThe second problem is an older docker-py version which results in the following error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/volker/.ansible/tmp/ansible-tmp-1443168797.18-81738364339485/docker\", line 3496, in <module>\r\n    main()\r\n  File \"/home/volker/.ansible/tmp/ansible-tmp-1443168797.18-81738364339485/docker\", line 1719, in main\r\n    started(manager, containers, count, name)\r\n  File \"/home/volker/.ansible/tmp/ansible-tmp-1443168797.18-81738364339485/docker\", line 1566, in started\r\n    created = manager.create_containers(delta)\r\n  File \"/home/volker/.ansible/tmp/ansible-tmp-1443168797.18-81738364339485/docker\", line 1454, in create_containers\r\n    containers = do_create(count, params)\r\n  File \"/home/volker/.ansible/tmp/ansible-tmp-1443168797.18-81738364339485/docker\", line 1447, in do_create\r\n    result = self.client.create_container(**params)\r\nTypeError: create_container() got an unexpected keyword argument 'cpuset'\r\n\r\n```\r\n\r\nThis is fixed with 93432d94afc68eb8fa7e1e59646805e3ec470c21"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/148487767","html_url":"https://github.com/ansible/ansible-modules-core/pull/2154#issuecomment-148487767","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2154","id":148487767,"user":{"login":"v0lk3r","id":971646,"avatar_url":"https://avatars.githubusercontent.com/u/971646?v=3","gravatar_id":"","url":"https://api.github.com/users/v0lk3r","html_url":"https://github.com/v0lk3r","followers_url":"https://api.github.com/users/v0lk3r/followers","following_url":"https://api.github.com/users/v0lk3r/following{/other_user}","gists_url":"https://api.github.com/users/v0lk3r/gists{/gist_id}","starred_url":"https://api.github.com/users/v0lk3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/v0lk3r/subscriptions","organizations_url":"https://api.github.com/users/v0lk3r/orgs","repos_url":"https://api.github.com/users/v0lk3r/repos","events_url":"https://api.github.com/users/v0lk3r/events{/privacy}","received_events_url":"https://api.github.com/users/v0lk3r/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T18:55:28Z","updated_at":"2015-10-15T18:55:28Z","body":"I'll vote for using the PR as proposed in #2239. Unfortunately I didn't see the version check function, therefore #2239 is the cleaner solution. Using the property to access the api_version like I did is nothing more than cosmetic ;)\r\n\r\n=> I'll close my PR."}}