TritonDataCenter / sdc-docker

Docker Engine for Triton
Mozilla Public License 2.0
182 stars 49 forks source link

Fail to run ansible in docker connect way #124

Open dsheng opened 7 years ago

dsheng commented 7 years ago

Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py

ESTABLISH DOCKER CONNECTION FOR USER: mysql EXEC ['docker', u'--tls', u'--tlscacert=/root/.sdc/docker/jill/ca.pem', u'--tlscert=/root/.sdc/docker/jill/cert.pem', u'--tlskey=/root/.sdc/docker/jill/key.pem', 'exec', '-u', u'mysql', '-i', u'ansible_mysql_1', u'/bin/sh', '-c', u'/bin/sh -c \'( umask 77 && mkdir -p "` echo /tmp/ansible-tmp-1498819989.43-126392766186482 `" && echo ansible-tmp-1498819989.43-126392766186482="` echo /tmp/ansible-tmp-1498819989.43-126392766186482 `" ) && sleep 0\''] fatal: [localhost]: UNREACHABLE! => { "changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo /tmp/ansible-tmp-1498819989.43-126392766186482 `\" && echo ansible-tmp-1498819989.43-126392766186482=\"` echo /tmp/ansible-tmp-1498819989.43-126392766186482 `\" ), exited with result 1", "unreachable": true } Maybe two issues here: 1. It seems dockerapi cann't parse the command correctly, which is wrapped by \' . 2. Failed to upload the command to the temporary direct in the container, when ansible PUT it. Help to check & fix it, thanks