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

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

technolo-g opened this issue Jan 17, 2015 · 4 comments

Comments

@technolo-g
Copy link

@technolo-g technolo-g commented Jan 17, 2015

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 lorin commented Jan 26, 2015

Loading

@abadger
Copy link
Contributor

@abadger 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?

Loading

@abadger
Copy link
Contributor

@abadger abadger commented Mar 13, 2015

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

Loading

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

@jimi-c jimi-c commented Jul 12, 2016

Closing per the above.

Loading

@jimi-c jimi-c closed this Jul 12, 2016
@jimi-c jimi-c removed the needs_info label Jul 12, 2016
@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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants