Issue 1:
From @henryon on 2016-09-13T10:01:51Z

ISSUE TYPE

Bug Report

COMPONENT NAME

shell module

ANSIBLE VERSION

ansible 2.1.1.0
config file =
configured module search path = Default w/o overrides

CONFIGURATION

roles_path = ./roles

callback_plugins = ./plugins/callback_plugins

lookup_plugins = ./plugins/lookup_plugins

inventory = inventory

gathering = smart

OS / ENVIRONMENT

Mac OS EI 10.11.3

SUMMARY

The script works on ansible 1.9.1 while 2.1.1.0 doesn't work. I've no idea about this?

STEPS TO REPRODUCE

ansible-playbook playbooks/sample.yml

- name: Download AWS Security Group
hosts: localhost
connection: local
gather_facts: False
tasks:
- shell: ../roles/script/files/test.py > /tmp/test.yml

the ../roles/script/files/test.py has below information

# !/usr/bin/env python

import os

print os.path

EXPECTED RESULTS

The python script should work in 2.1.1.0

ACTUAL RESULTS

It's failed.

TASK [command] *****************************************************************
task path: /Users/Test/production/ansible/playbooks/security-group.yml:6
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: HenryWen
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1473759673.83-249336867857451 `" && echo ansible-tmp-1473759673.83-249336867857451="` echo $HOME/.ansible/tmp/ansible-tmp-1473759673.83-249336867857451 `" ) && sleep 0'
<127.0.0.1> PUT /var/folders/st/7gf56xv52jn97pthscx8sdw00000gn/T/tmp35KP0I TO /Users/Test/.ansible/tmp/ansible-tmp-1473759673.83-249336867857451/command
<127.0.0.1> EXEC /bin/sh -c 'LANG=zh_CN.UTF-8 LC_ALL=zh_CN.UTF-8 LC_MESSAGES=zh_CN.UTF-8 /usr/bin/python /Users/Test/.ansible/tmp/ansible-tmp-1473759673.83-249336867857451/command; rm -rf "/Users/Test/.ansible/tmp/ansible-tmp-1473759673.83-249336867857451/" > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "../roles/script/files/test.py > /tmp/security_groups.yml", "delta": "0:00:00.004941", "end": "2016-09-13 17:41:13.979999", "failed": true, "invocation": {"module_args": {"_raw_params": "../roles/script/files/test.py > /tmp/test.yml", "_uses_shell": true, "chdir": null, "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "rc": 127, "start": "2016-09-13 17:41:13.975058", "stderr": "/bin/sh: ../roles/script/files/test
.py: No such file or directory", "stdout": "", "stdout_lines": [], "warnings": []}

Copied from original issue: ansible/ansible-modules-core#4806

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

core

ANSIBLE VERSION

2.1.0.0

CONFIGURATION

hash_behaviour = merge

OS / ENVIRONMENT

Ubuntu 14.04.1

SUMMARY

If my delegated host not match limit delegated host_vars are not loaded.

STEPS TO REPRODUCE

---
- hosts: webserver
tasks:
- raw: echo toto
delegate_to: windows_server

host_vars/windows_server

ansible_connection: winrm
ansible_password: password
ansible_user: user

EXPECTED RESULTS

ansible-playbook -u user --limit=webserver:windows_server -k test.yml

PLAYBOOK: test.yml *********************************************************
1 plays in test.yml PLAY [echo toto ******************************************
TASK [setup] *******************************************************************
ok: [webserver]
TASK [echo toto] ******************************************************
ok: [webserver-> windows_server] => {"changed": false, "invocation": {"module_args": {"_raw_params": "echo toto"}, "module_name": "raw"}, "rc": 0, "stderr": "#< CLIXML\r\n<Objs Version=\"1.1.0.1\" xmlns=\"http://schemas.microsoft.com/powershell/2004/04\"><Obj S=\"progress\" RefId=\"0\"><TN RefId=\"0\"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N=\"SourceId\">1</I64><PR N=\"Record\"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>", "stdout": "toto\r\n", "stdout_lines": ["toto"]}

PLAY RECAP *********************************************************************
webserver : ok=2 changed=0 unreachable=0 failed=0

ACTUAL RESULTS

ansible-playbook -u user --limit=webserver -k test.yml

PLAYBOOK: test.yml *********************************************************
1 plays in test.yml PLAY [echo toto ******************************************
TASK [setup] *******************************************************************
ok: [webserver]
TASK [echo toto] ******************************************************
task path: /path/toto.yml:4 <windows_server> ESTABLISH SSH CONNECTION FOR USER: user <windows_server> SSH: ansible.cfg set ssh_args: (-o)(ServerAliveCountMax=10)(-o)(ServerAliveInterval=30) <windows_server> SSH: ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled: (-o)(StrictHostKeyChecking=no) <windows_server> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=user) <windows_server> SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=20) <windows_server> SSH: PlayContext set ssh_common_args: () <windows_server> SSH: PlayContext set ssh_extra_args: () <windows_server> SSH: EXEC sshpass -d19 ssh -C -vvv -o ServerAliveCountMax=10 -o ServerAliveInterval=30 -o StrictHostKeyChecking=no -o User=user -o ConnectTimeout=20 -tt windows_server '/bin/sh -c '"'"'echo toto && sleep 0'"'"''
fatal: [webserver]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh.", "unreachable": true}
to retry, use: --limit @test.retry

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