philm / ansible_playbook

Docker Image for running Ansible Playbook commands
108 stars 78 forks source link

connectivity problems with ansible_target image #3

Closed cordoval closed 8 years ago

cordoval commented 8 years ago

I sorted out most problems now but this is blocking:

docker-compose up -d
Creating ansible_target
Creating drugimport_playbooks_1
Creating ansible_player
docker-compose run player download_files_from_ftp.yml -i inventory

PLAY ***************************************************************************

TASK [setup] *******************************************************************
fatal: [ansible_target]: UNREACHABLE! => {"changed": false, "msg": "ERROR! SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh", "unreachable": true}

PLAY RECAP *********************************************************************
ansible_target             : ok=0    changed=0    unreachable=1    failed=0

make: *** [import] Error 3

Update: trying this https://github.com/ansible/ansible/issues/13401

philm commented 8 years ago

Do you have the SSH key volume mounted (see readme)?

cordoval commented 8 years ago

yes:

target:
  image: philm/ansible_target:latest
  container_name: ansible_target
  expose:
    - "22"
  volumes:
    - ~/.ssh/id_rsa.pub:/home/ubuntu/.ssh/authorized_keys
  privileged: true

player:
  build: ./player
  container_name: ansible_player
  links:
    - target
  volumes:
    - ~/.ssh/id_rsa:/root/.ssh/id_rsa
    - ~/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub
  volumes_from:
    - playbooks

playbooks:
  build: playbooks/

update unless you mean i have to add a container with the keys themselves from my machine ... hmm

cordoval commented 8 years ago

nvm i sorted it out, i plugged new keys and rebuild repos and it works like a charm.