Issue 1:
Ansible version

ansible 2.0.0 (stable-2.0 b9fbfaf64e) last updated 2015/12/03 08:27:24 (GMT +300)
lib/ansible/modules/core: (detached HEAD 273112c56d) last updated 2015/11/24 09:00:04 (GMT +300)
lib/ansible/modules/extras: (detached HEAD e46e2e1d6f) last updated 2015/11/24 09:00:04 (GMT +300)

Summary

The playbook that worked fine a couple of days ago is now failing with

fatal: [trusty]: UNREACHABLE! => {"changed": false, "msg": "ERROR! SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue", "unreachable": true}

in the middle of the play.

The task in question looks like this:

- name: user for accepting pushed backups on the backup buddy
user: name="{{ backup_user }}" state=present
delegate_to: "{{ backup_buddy }}"
when: backup_buddy != ""
tags: [ backups, user, FAIL ]

The failure happens on host trusty, which is a Vagrant VM. host_vars/trusty sets backup_buddy to precise, which is a different Vagrant VM. The inventory file is generated by Vagrant's Ansible provisioner and looks like this:

trusty ansible_ssh_host=127.0.0.1 ansible_ssh_port=2200 ansible_ssh_private_key_file=/home/mg/src/deployments/provisioning/.vagrant/machines/trusty/virtualbox/private_key
precise ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222 ansible_ssh_private_key_file=/home/mg/src/deployments/provisioning/.vagrant/machines/precise/virtualbox/private_key

The SSH command shown in -vvvv mode looks like this:

<127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: None
<127.0.0.1> SSH: EXEC ssh -C -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o Port=2222 -o 'IdentityFile="/home/mg/src/deployments/provisioning/.vagrant/machines/precise/virtualbox/private_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/mg/.ansible/cp/ansible-ssh-%h-%p-%r -tt 127.0.0.1 (umask 22 && mkdir -p "`echo $HOME/.ansible/tmp/ansible-tmp-1449125747.77-81162502568054`" && echo "`echo $HOME/.ansible/tmp/ansible-tmp-1449125747.77-81162502568054`")

and the ssh output is long and boring, but shows this

...
debug1: Authenticating to 127.0.0.1:2222 as 'mgedmin'
...
Permission denied (publickey,password).

mgedmin is my username on the host. There's no mgedmin user in the Vagrant VM. My ansible.cfg defines

remote_user = vagrant

and that's what I expect to be used.

Issue 2:
Issue Type: Bug Report (2.0 regression)

Ansible Version: 2.0.0 (devel)

Ansible Configuration: default

Environment: Ubuntu 14.04

Summary:

delegate_to does not use user specified with remote_user.

Steps To Reproduce:

Following playbook works correctly on 1.9.4 with output root and on devel it outputs normal user.

---
- hosts:
- test-vm
become: yes

tasks:
- command: whoami
register: whoami
delegate_to: "test-vm2"
remote_user: root
become: false

- debug: msg="{{ whoami.stdout }}"

Expected Results:

ok: [test] => {
"changed": false,
"invocation": {
"module_args": {
"msg": "root"
},
"module_name": "debug"
},
"msg": "root
}

Actual Results:

ok: [test] => {
"changed": false,
"invocation": {
"module_args": {
"msg": "username"
},
"module_name": "debug"
},
"msg": "username"
}