Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

win_reboot

ANSIBLE VERSION

ansible 2.1.0.0

CONFIGURATION

retry_files_enabled = False

OS / ENVIRONMENT

N/A

SUMMARY

The win_reboot action incorrectly assumes that the WinRM connection transport is being utilized to speak to the machine, however if someone is running a custom ansible transport, win_reboot assumes that the transport has properties such as _winrm_host, _winrm_port, and _reset().

STEPS TO REPRODUCE

Use a custom transport to talk to a Windows machine and use the win_reboot function (sadly, our transport is not open sourced yet. Coming soon!).

ansible/lib/ansible/plugins/action/win_reboot.py

Lines 79 to 80
in
6787fc7

winrm_host = self._connection._winrm_host

winrm_port = self._connection._winrm_port

ansible/lib/ansible/plugins/action/win_reboot.py

Line 115
in
6787fc7

self._connection._reset()

EXPECTED RESULTS

I would hope we can make it so that an action doesn't implicitly depend on WinRM being the transport.

ACTUAL RESULTS

It does implicitly depend on WinRM being the transport. :-)

Issue 2:
Ansible hangs on docker_image building when the image already exists. The whole playground is at https://github.com/nolar/vagrant-ansible-docker-sample/tree/docker_image_broken branch (pretty simple).

Specifically, this task causes the problem (playbook.xml, line 97):

- name: Build or re-build an image.
sudo: yes
#FIXME: Hangs on recv() somewhere inside docker-py (if the image exists?).
docker_image: name=mycont path=Docker.dir state=build
#shell: docker build -t mycont ~{{ansible_ssh_user}}/Docker.dir

To reproduce:

vagrant up — it works fine for the first time (provision implied).

vagrant provision — hangs on this task.

If you log into, remove the image (mycont), then provision it again, it works for the first time, and hangs for the second time. This is why my assumption is it hangs when the image already exists.

vagrant ssh

docker kill timer_from_image && docker rm timer_from_image

docker rmi mycont

exit

vagrant provision — first time is ok

vagrant provision — second time it hangs or shows an "unknown error"

If launched by hand from inside, and then interrupted with Ctrl+C (after it hangs), the stackdump is a follows:

ANSIBLE_KEEP_REMOTE_FILES=1 vagrant provision

Wait till it hags, Ctrl+C, copy-paste the last command.

vagrant ssh

/usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1403972347.56-120405055892302/docker_image

Wait 5-10 secs, Ctrl+C

vagrant@vagrant-ubuntu-trusty-64:~$ /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1403972347.56-120405055892302/docker_image
^CTraceback (most recent call last):
File "/home/vagrant/.ansible/tmp/ansible-tmp-1403972347.56-120405055892302/docker_image", line 1554, in <module>
main()
File "/home/vagrant/.ansible/tmp/ansible-tmp-1403972347.56-120405055892302/docker_image", line 234, in main
image_id = manager.build()
File "/home/vagrant/.ansible/tmp/ansible-tmp-1403972347.56-120405055892302/docker_image", line 144, in build
for chunk in stream:
File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 229, in _stream_helper
size_line = socket.readline()
KeyboardInterrupt

Command-line approach (i.e. not through docker-py) works fine.