{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1838","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1838/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1838/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1838/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/1838","id":98026336,"number":1838,"title":"docker-module does not work with tls-enabled","user":{"login":"jarmoni","id":2826961,"avatar_url":"https://avatars.githubusercontent.com/u/2826961?v=3","gravatar_id":"","url":"https://api.github.com/users/jarmoni","html_url":"https://github.com/jarmoni","followers_url":"https://api.github.com/users/jarmoni/followers","following_url":"https://api.github.com/users/jarmoni/following{/other_user}","gists_url":"https://api.github.com/users/jarmoni/gists{/gist_id}","starred_url":"https://api.github.com/users/jarmoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarmoni/subscriptions","organizations_url":"https://api.github.com/users/jarmoni/orgs","repos_url":"https://api.github.com/users/jarmoni/repos","events_url":"https://api.github.com/users/jarmoni/events{/privacy}","received_events_url":"https://api.github.com/users/jarmoni/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-29T20:48:31Z","updated_at":"2015-07-29T23:00:00Z","closed_at":"2015-07-29T23:00:00Z","body":"I use a self signed certificate, docker-daemon is properly configured, when I execute docker-commands from the command-line, everything works fine.\r\n\r\n* I'm running the devel-Branch (ansible and ansible-modules-core\r\n* docker-version is 1.7.1 (API-version 1.19)\r\n* Issue occurs with docker-py  v1.3.1 and v1.2.3 as well\r\n* environment variable ${DOCKER_CERT_PATH} is set\r\n\r\n```\r\n- hosts: hosts\r\n  tasks:\r\n  - name: install docker-registry\r\n    docker:\r\n      docker_api_version: \"1.19\"\r\n      docker_url: \"tcp://{{inventory_hostname}}:2376\"\r\n      name: registry\r\n      image: registry:2\r\n      restart_policy: always\r\n      state: reloaded\r\n      use_tls: \"verify\"\r\n      volumes:\r\n      - /volumes/registry:/var/lib/registry\r\n      - /etc/localtime:/etc/localtime:ro\r\n      ports:\r\n      - 0.0.0.0:5000:5000\r\n```\r\nresults in:\r\n```\r\nfatal: [devdocker1]: FAILED! => {\"changed\": false, \"failed\": true, \"msg\": \"SSLError(SSLError(SSLError(1, '_ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed'),),)\"}\r\n```\r\nwhen I set *use_tls: \"encrypt\" I get:\r\n```\r\nfatal: [devdocker1]: FAILED! => {\"changed\": false, \"failed\": true, \"msg\": \"SSLError(SSLError(SSLError(1, '_ssl.c:510: error:14094412:SSL routines:SSL3_READ_BYTES:sslv3 alert bad certificate'),),)\"}\r\n```\r\nwhen I set *tls_ca_cert*, *tls_client_cert* and *tls_client_key* explicit (either with *use_tls: verify* or *use_tls: encrypt* I receive:\r\n```\r\nfatal: [devdocker1]: FAILED! => {\"changed\": false, \"failed\": true, \"msg\": \"BECOME-SUCCESS-mcmhixmneemjuvplykneygttkgbqapwr\\r\\nTraceback (most recent call last):\\r\\n  File \\\"/home/vagrant/.ansible/tmp/ansible-tmp-1438202239.97-81917707480990/docker\\\", line 3428, in <module>\\r\\n    main()\\r\\n  File \\\"/home/vagrant/.ansible/tmp/ansible-tmp-1438202239.97-81917707480990/docker\\\", line 1673, in main\\r\\n    manager = DockerManager(module)\\r\\n  File \\\"/home/vagrant/.ansible/tmp/ansible-tmp-1438202239.97-81917707480990/docker\\\", line 706, in __init__\\r\\n    tls_config = docker.tls.TLSConfig(**params)\\r\\n  File \\\"/usr/local/lib/python2.7/dist-packages/docker/tls.py\\\", line 46, in __init__\\r\\n    'Path to a certificate and key files must be provided'\\r\\ndocker.errors.TLSParameterError: Path to a certificate and key files must be provided through the client_config param. TLS configurations should map the Docker CLI client configurations. See http://docs.docker.com/examples/https/ for API details.\\r\\n\", \"parsed\": false\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/126121495","html_url":"https://github.com/ansible/ansible-modules-core/issues/1838#issuecomment-126121495","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1838","id":126121495,"user":{"login":"jarmoni","id":2826961,"avatar_url":"https://avatars.githubusercontent.com/u/2826961?v=3","gravatar_id":"","url":"https://api.github.com/users/jarmoni","html_url":"https://github.com/jarmoni","followers_url":"https://api.github.com/users/jarmoni/followers","following_url":"https://api.github.com/users/jarmoni/following{/other_user}","gists_url":"https://api.github.com/users/jarmoni/gists{/gist_id}","starred_url":"https://api.github.com/users/jarmoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarmoni/subscriptions","organizations_url":"https://api.github.com/users/jarmoni/orgs","repos_url":"https://api.github.com/users/jarmoni/repos","events_url":"https://api.github.com/users/jarmoni/events{/privacy}","received_events_url":"https://api.github.com/users/jarmoni/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T23:00:00Z","updated_at":"2015-07-29T23:00:00Z","body":"no issue at all. ${DOCKER_CERT_PATH} pointed to my local machine. So the tls-stuff could not be found"}}