Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: Ansible does not work with TLS enabled on a Docker daemon #10032

Closed
technolo-g opened this issue Jan 17, 2015 · 4 comments
Closed
Labels
docker feature This issue/PR relates to a feature request.

Comments

@technolo-g
Copy link

Issue Type: Bug Report
Ansible Version: ansible 1.8.2
Environment: Mac OSX Yosemite
Summary:

After enabling TLS for Docker connections in the environment, Ansbile does not seem to use the settings.

Steps To Reproduce:

When the following env vars are set:

DOCKER_HOST=tcp://dockerhost01:2376
DOCKER_TLS_VERIFY=1
DOCKER_CERT_PATH=/Users/mbajor/Dev/docker-swarm/master/tls

and the following playbook is run:


---

- hosts: local
  connection: local
  gather_facts: False
  vars:
    docker_host: "{{ lookup('env','DOCKER_HOST') }}"
  tasks:
  - name: Run an Nginx container
    docker: >
      docker_url={{ docker_host }}
      image=nginx:latest
      publish_all_ports=True
      hostname=nginx
      state=running
      count=10
    register: nginx_container

The following error output occurs:

PLAY [local] ******************************************************************

TASK: [Run an Nginx container] ************************************************
failed: [localhost] => {"changed": false, "failed": true}
msg: ConnectionError(ProtocolError('Connection aborted.', BadStatusLine('\x15\x03\x01\x00\x02\x02\n',)),)

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/Users/mbajor/demo_containers.retry

localhost                  : ok=0    changed=0    unreachable=0    failed=1

Which appears to indicate that it is making a connection over HTTP

Expected Results:

I would expect Ansible to connect to the Docker daemon and provision the containers

Actual Results:

Ansible exits with a '2' status code

@bcoca bcoca added P3 labels Jan 19, 2015
@lorin
Copy link
Contributor

lorin commented Jan 26, 2015

Related: ansible/ansible-modules-core#272

@abadger
Copy link
Contributor

abadger commented Mar 13, 2015

I believe that this is fixed in devel and the stable-1.9 branch (will be in 1.9rc2). Care to test that out?

@abadger abadger added the needs_info This issue requires further information. Please answer any outstanding questions. label Mar 13, 2015
@abadger
Copy link
Contributor

abadger commented Mar 13, 2015

PR with the change is here: ansible/ansible-modules-core#926

@jimi-c jimi-c removed the P3 label Dec 7, 2015
@jimi-c
Copy link
Member

jimi-c commented Jul 12, 2016

Closing per the above.

@jimi-c jimi-c closed this as completed Jul 12, 2016
@jimi-c jimi-c removed the needs_info This issue requires further information. Please answer any outstanding questions. label Jul 12, 2016
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_idea labels Mar 2, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docker feature This issue/PR relates to a feature request.
Projects
None yet
Development

No branches or pull requests

7 participants