Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

include_role

ANSIBLE VERSION

ansible 2.3.1.0
config file = /usr/local/etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.13 (default, Jun 18 2017, 09:55:08) [GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)]

CONFIGURATION

OS / ENVIRONMENT

FreeBSD server, CentOS client

SUMMARY

Tasks from role included via include_role are duplicated if used inside dependencies.

STEPS TO REPRODUCE

role 'technical'

role 'base' inlcudes 'technical' via include_role

role 'service1' depends on 'base'

role 'service2' depends on 'base'

playbook applies roles 'service1', 'service2' to a host.

EXPECTED RESULTS

applied tasks from roles:

'base' (with 'technical'), 'service1', 'service2'

ACTUAL RESULTS

applied tasks from roles:

'base' (with 'technical"), 'service1', 'technical', 'service2'

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

yum

ANSIBLE VERSION

ansible 2.3.2.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.5 (default, Nov 6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]

CONFIGURATION

Using default configuration

OS / ENVIRONMENT

Ansible is running on CentOS 7.3 and is trying to manage another CentOS 7.3 system.

SUMMARY

Using the yum module with the list parameter fails with a message like "Shared connection to xxxxx closed."

STEPS TO REPRODUCE

---
- hosts: example-host
remote_user: root
gather_facts: no
tasks:

- name: List ansible packages and register result to print with debug later.
yum:
list: ansible
register: result
...

EXPECTED RESULTS

I expected to get a list of packages in the result variable

ACTUAL RESULTS

The module fails with "Shared connection to example-host closed."

Using /etc/ansible/ansible.cfg as config file
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc

PLAYBOOK: yum_error.yml ****************************************************************
1 plays in yum_error.yml

PLAY [example-host] ************************************************************************
META: ran handlers

TASK [List ansible packages and register result to print with debug later.] ************
task path: /root/yum_error.yml:7
Using module file /usr/lib/python2.7/site-packages/ansible/modules/packaging/os/yum.py
<example-host> ESTABLISH SSH CONNECTION FOR USER: root
<example-host> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/d96313e4bf example-host '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<example-host> (0, '/root\n', 'OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /root/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 51: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 9532\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<example-host> ESTABLISH SSH CONNECTION FOR USER: root
<example-host> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/d96313e4bf example-host '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1500387081.41-174099514042964 `" && echo ansible-tmp-1500387081.41-174099514042964="` echo /root/.ansible/tmp/ansible-tmp-1500387081.41-174099514042964 `" ) && sleep 0'"'"''
<example-host> (0, 'ansible-tmp-1500387081.41-174099514042964=/root/.ansible/tmp/ansible-tmp-1500387081.41-174099514042964\n', 'OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /root/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 51: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 9532\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<example-host> PUT /tmp/tmp5PxZfO TO /root/.ansible/tmp/ansible-tmp-1500387081.41-174099514042964/yum.py
<example-host> SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/d96313e4bf '[example-host]'
<example-host> (0, 'sftp> put /tmp/tmp5PxZfO /root/.ansible/tmp/ansible-tmp-1500387081.41-174099514042964/yum.py\n', 'OpenSSH_7.4p1 (CentrifyDC build 5.4.1-447) , OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /root/.ssh/config\r\ndebug1: Reading configuration data /etc/centrifydc/ssh/ssh_config\r\ndebug1: /etc/centrifydc/ssh/ssh_config line 55: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 9532\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension "posix-rename@openssh.com" revision 1\r\ndebug2: Server supports extension "statvfs@openssh.com" revision 2\r\ndebug2: Server supports extension "fstatvfs@openssh.com" revision 2\r\ndebug2: Server supports extension "hardlink@openssh.com" revision 1\r\ndebug2: Server supports extension "fsync@openssh.com" revision 1\r\ndebug3: Sent message fd 6 T:16 I:1\r\ndebug3: SSH_FXP_REALPATH . -> /root size 0\r\ndebug3: Looking up /tmp/tmp5PxZfO\r\ndebug3: Sent message fd 6 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn\'t stat remote file: No such file or directory\r\ndebug3: Sent message SSH2_FXP_OPEN I:3 P:/root/.ansible/tmp/ansible-tmp-1500387081.41-174099514042964/yum.py\r\ndebug3: Sent message SSH2_FXP_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2_FXP_WRITE I:5 O:32768 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:6 O:65536 S:22946\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 5 32768 bytes at 32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 6 22946 bytes at 65536\r\ndebug3: Sent message SSH2_FXP_CLOSE I:4\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<example-host> ESTABLISH SSH CONNECTION FOR USER: root
<example-host> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/d96313e4bf example-host '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1500387081.41-174099514042964/ /root/.ansible/tmp/ansible-tmp-1500387081.41-174099514042964/yum.py && sleep 0'"'"''
<example-host> (0, '', 'OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /root/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 51: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 9532\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<example-host> ESTABLISH SSH CONNECTION FOR USER: root
<example-host> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/d96313e4bf -tt example-host '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1500387081.41-174099514042964/yum.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1500387081.41-174099514042964/" > /dev/null 2>&1 && sleep 0'"'"''
<example-host> (0, 'Traceback (most recent call last):\r\n File "/tmp/ansible_GUOpc4/ansible_module_yum.py", line 1267, in <module>\r\n main()\r\n File "/tmp/ansible_GUOpc4/ansible_module_yum.py", line 1225, in main\r\n params[\'disablerepo\'], params[\'enablerepo\'])}\r\n File "/tmp/ansible_GUOpc4/ansible_module_yum.py", line 652, in list_stuff\r\n is_available(module, repoq, stuff, conf_file, qf=qf, installroot=installroot)) if p.strip()]\r\n File "/tmp/ansible_GUOpc4/ansible_module_yum.py", line 597, in pkg_to_dict\r\n n,e,v,r,a,repo = pkgstr.split(\'|\')\r\nValueError: need more than 1 value to unpack\r\n', 'OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /root/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 51: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 9532\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to example-host closed.\r\n')
fatal: [example-host]: FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /root/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 51: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 9532\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to example-host closed.\r\n",
"module_stdout": "Traceback (most recent call last):\r\n File \"/tmp/ansible_GUOpc4/ansible_module_yum.py\", line 1267, in <module>\r\n main()\r\n File \"/tmp/ansible_GUOpc4/ansible_module_yum.py\", line 1225, in main\r\n params['disablerepo'], params['enablerepo'])}\r\n File \"/tmp/ansible_GUOpc4/ansible_module_yum.py\", line 652, in list_stuff\r\n is_available(module, repoq, stuff, conf_file, qf=qf, installroot=installroot)) if p.strip()]\r\n File \"/tmp/ansible_GUOpc4/ansible_module_yum.py\", line 597, in pkg_to_dict\r\n n,e,v,r,a,repo = pkgstr.split('|')\r\nValueError: need more than 1 value to unpack\r\n",
"msg": "MODULE FAILURE",
"rc": 0
}
to retry, use: --limit @/root/yum_error.retry

PLAY RECAP *****************************************************************************
example-host : ok=0 changed=0 unreachable=0 failed=1