<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">pacman module</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.13 (default, Feb 11 2017, 12:22:40) [GCC 6.3.1 20170109]"><pre class="notranslate"><code class="notranslate">ansible 2.3.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.13 (default, Feb 11 2017, 12:22:40) [GCC 6.3.1 20170109]
</code></pre></div>
<p dir="auto">This worked fine in Ansible 2.2.</p>
<h5 dir="auto">CONFIGURATION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[defaults]
nocows=1"><pre class="notranslate"><code class="notranslate">[defaults]
nocows=1
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">I'm running on Arch Linux</p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto">Running</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<p dir="auto"><a href="https://github.com/thomwiggers/odroid-playbooks/blob/master/roles/common/tasks/common.yml#L8-L16">https://github.com/thomwiggers/odroid-playbooks/blob/master/roles/common/tasks/common.yml#L8-L16</a></p>

<h5 dir="auto">EXPECTED RESULTS</h5>

<p dir="auto">Updated/installed packages</p>
<h5 dir="auto">ACTUAL RESULTS</h5>

<p dir="auto">Crashes.</p>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [common : Install packages] ************************************************************************************************************************************************************************************************************
task path: /home/thom/git/stage/management/roles/common/tasks/common.yml:8
Using module file /usr/lib/python2.7/site-packages/ansible/modules/packaging/os/pacman.py
&lt;homer&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;homer&gt; SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/thom/.ansible/cp/fdc2bea664 homer '/bin/sh -c '&quot;'&quot;'echo ~ &amp;&amp; sleep 0'&quot;'&quot;''
&lt;homer&gt; (0, '/home/thom\n', &quot;OpenSSH_7.5p1, OpenSSL 1.1.0e  16 Feb 2017\r\ndebug1: Reading configuration data /home/thom/.ssh/config\r\ndebug1: /home/thom/.ssh/config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256]\r\ndebug1: /home/thom/.ssh/config line 82: Applying options for homer\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Setting implicit ProxyCommand from ProxyJump: ssh -l twiggers -vvv -W '[%h]:%p' lilo.science.ru.nl\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 = 7302\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&quot;)
&lt;homer&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;homer&gt; SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/thom/.ansible/cp/fdc2bea664 homer '/bin/sh -c '&quot;'&quot;'( umask 77 &amp;&amp; mkdir -p &quot;` echo /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474 `&quot; &amp;&amp; echo ansible-tmp-1493382410.32-244000386629474=&quot;` echo /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474 `&quot; ) &amp;&amp; sleep 0'&quot;'&quot;''
&lt;homer&gt; (0, 'ansible-tmp-1493382410.32-244000386629474=/home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474\n', &quot;OpenSSH_7.5p1, OpenSSL 1.1.0e  16 Feb 2017\r\ndebug1: Reading configuration data /home/thom/.ssh/config\r\ndebug1: /home/thom/.ssh/config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256]\r\ndebug1: /home/thom/.ssh/config line 82: Applying options for homer\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Setting implicit ProxyCommand from ProxyJump: ssh -l twiggers -vvv -W '[%h]:%p' lilo.science.ru.nl\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 = 7302\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&quot;)
&lt;homer&gt; PUT /tmp/tmp3nwsZr TO /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/pacman.py
&lt;homer&gt; SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/thom/.ansible/cp/fdc2bea664 '[homer]'
&lt;homer&gt; (0, 'sftp&gt; put /tmp/tmp3nwsZr /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/pacman.py\n', 'OpenSSH_7.5p1, OpenSSL 1.1.0e  16 Feb 2017\r\ndebug1: Reading configuration data /home/thom/.ssh/config\r\ndebug1: /home/thom/.ssh/config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256]\r\ndebug1: /home/thom/.ssh/config line 82: Applying options for homer\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Setting implicit ProxyCommand from ProxyJump: ssh -l twiggers -vvv -W \'[%h]:%p\' lilo.science.ru.nl\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 = 7302\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 &quot;posix-rename@openssh.com&quot; revision 1\r\ndebug2: Server supports extension &quot;statvfs@openssh.com&quot; revision 2\r\ndebug2: Server supports extension &quot;fstatvfs@openssh.com&quot; revision 2\r\ndebug2: Server supports extension &quot;hardlink@openssh.com&quot; revision 1\r\ndebug2: Server supports extension &quot;fsync@openssh.com&quot; revision 1\r\ndebug3: Sent message fd 5 T:16 I:1\r\ndebug3: SSH_FXP_REALPATH . -&gt; /home/thom size 0\r\ndebug3: Looking up /tmp/tmp3nwsZr\r\ndebug3: Sent message fd 5 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:/home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/pacman.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:27437\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 5 27437 bytes at 32768\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')
&lt;homer&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;homer&gt; SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/thom/.ansible/cp/fdc2bea664 homer '/bin/sh -c '&quot;'&quot;'chmod u+x /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/ /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/pacman.py &amp;&amp; sleep 0'&quot;'&quot;''
&lt;homer&gt; (0, '', &quot;OpenSSH_7.5p1, OpenSSL 1.1.0e  16 Feb 2017\r\ndebug1: Reading configuration data /home/thom/.ssh/config\r\ndebug1: /home/thom/.ssh/config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256]\r\ndebug1: /home/thom/.ssh/config line 82: Applying options for homer\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Setting implicit ProxyCommand from ProxyJump: ssh -l twiggers -vvv -W '[%h]:%p' lilo.science.ru.nl\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 = 7302\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&quot;)
&lt;homer&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;homer&gt; SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/thom/.ansible/cp/fdc2bea664 -tt homer '/bin/sh -c '&quot;'&quot;'sudo -H -S -n -u root /bin/sh -c '&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'echo BECOME-SUCCESS-tixkiailijheyhbmsllbeczwqwdaiueq; /usr/bin/python /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/pacman.py; rm -rf &quot;/home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/&quot; &gt; /dev/null 2&gt;&amp;1'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;' &amp;&amp; sleep 0'&quot;'&quot;''
&lt;homer&gt; (0, 'Traceback (most recent call last):\r\n  File &quot;/tmp/ansible_nbtluy_z/ansible_module_pacman.py&quot;, line 451, in &lt;module&gt;\r\n    main()\r\n  File &quot;/tmp/ansible_nbtluy_z/ansible_module_pacman.py&quot;, line 443, in main\r\n    install_packages(module, pacman_path, p[\'state\'], pkgs, pkg_files)\r\n  File &quot;/tmp/ansible_nbtluy_z/ansible_module_pacman.py&quot;, line 306, in install_packages\r\n    data = stdout.split(\'\\n\')[3].split(\' \')[2:]\r\nIndexError: list index out of range\r\n', &quot;OpenSSH_7.5p1, OpenSSL 1.1.0e  16 Feb 2017\r\ndebug1: Reading configuration data /home/thom/.ssh/config\r\ndebug1: /home/thom/.ssh/config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256]\r\ndebug1: /home/thom/.ssh/config line 82: Applying options for homer\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Setting implicit ProxyCommand from ProxyJump: ssh -l twiggers -vvv -W '[%h]:%p' lilo.science.ru.nl\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 = 7302\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 131.174.12.215 closed.\r\n&quot;)
failed: [homer] (item=[u'ack', u'base-devel', u'clang', u'cmake', u'cronie', u'curl', u'git', u'htop', u'ltrace', u'ntp', u'openbsd-netcat', u'python', u'python-pip', u'python-virtualenv', u'python-virtualenvwrapper', u'python2', u'python2-pip', u'rsync', u'strace', u'svn', u'the_silver_searcher', u'tmux', u'valgrind', u'vim', u'wget', u'zsh']) =&gt; {
    &quot;failed&quot;: true, 
    &quot;item&quot;: [
        &quot;ack&quot;, 
        &quot;base-devel&quot;, 
        &quot;clang&quot;, 
        &quot;cmake&quot;, 
        &quot;cronie&quot;, 
        &quot;curl&quot;, 
        &quot;git&quot;, 
        &quot;htop&quot;, 
        &quot;ltrace&quot;, 
        &quot;ntp&quot;, 
        &quot;openbsd-netcat&quot;, 
        &quot;python&quot;, 
        &quot;python-pip&quot;, 
        &quot;python-virtualenv&quot;, 
        &quot;python-virtualenvwrapper&quot;, 
        &quot;python2&quot;, 
        &quot;python2-pip&quot;, 
        &quot;rsync&quot;, 
        &quot;strace&quot;, 
        &quot;svn&quot;, 
        &quot;the_silver_searcher&quot;, 
        &quot;tmux&quot;, 
        &quot;valgrind&quot;, 
        &quot;vim&quot;, 
        &quot;wget&quot;, 
        &quot;zsh&quot;
    ], 
    &quot;module_stderr&quot;: &quot;OpenSSH_7.5p1, OpenSSL 1.1.0e  16 Feb 2017\r\ndebug1: Reading configuration data /home/thom/.ssh/config\r\ndebug1: /home/thom/.ssh/config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256]\r\ndebug1: /home/thom/.ssh/config line 82: Applying options for homer\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Setting implicit ProxyCommand from ProxyJump: ssh -l twiggers -vvv -W '[%h]:%p' lilo.science.ru.nl\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 = 7302\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 131.174.12.215 closed.\r\n&quot;, 
    &quot;module_stdout&quot;: &quot;Traceback (most recent call last):\r\n  File \&quot;/tmp/ansible_nbtluy_z/ansible_module_pacman.py\&quot;, line 451, in &lt;module&gt;\r\n    main()\r\n  File \&quot;/tmp/ansible_nbtluy_z/ansible_module_pacman.py\&quot;, line 443, in main\r\n    install_packages(module, pacman_path, p['state'], pkgs, pkg_files)\r\n  File \&quot;/tmp/ansible_nbtluy_z/ansible_module_pacman.py\&quot;, line 306, in install_packages\r\n    data = stdout.split('\\n')[3].split(' ')[2:]\r\nIndexError: list index out of range\r\n&quot;, 
    &quot;msg&quot;: &quot;MODULE FAILURE&quot;, 
    &quot;rc&quot;: 0
}"><pre class="notranslate"><code class="notranslate">TASK [common : Install packages] ************************************************************************************************************************************************************************************************************
task path: /home/thom/git/stage/management/roles/common/tasks/common.yml:8
Using module file /usr/lib/python2.7/site-packages/ansible/modules/packaging/os/pacman.py
&lt;homer&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;homer&gt; SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/thom/.ansible/cp/fdc2bea664 homer '/bin/sh -c '"'"'echo ~ &amp;&amp; sleep 0'"'"''
&lt;homer&gt; (0, '/home/thom\n', "OpenSSH_7.5p1, OpenSSL 1.1.0e  16 Feb 2017\r\ndebug1: Reading configuration data /home/thom/.ssh/config\r\ndebug1: /home/thom/.ssh/config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256]\r\ndebug1: /home/thom/.ssh/config line 82: Applying options for homer\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Setting implicit ProxyCommand from ProxyJump: ssh -l twiggers -vvv -W '[%h]:%p' lilo.science.ru.nl\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 = 7302\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")
&lt;homer&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;homer&gt; SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/thom/.ansible/cp/fdc2bea664 homer '/bin/sh -c '"'"'( umask 77 &amp;&amp; mkdir -p "` echo /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474 `" &amp;&amp; echo ansible-tmp-1493382410.32-244000386629474="` echo /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474 `" ) &amp;&amp; sleep 0'"'"''
&lt;homer&gt; (0, 'ansible-tmp-1493382410.32-244000386629474=/home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474\n', "OpenSSH_7.5p1, OpenSSL 1.1.0e  16 Feb 2017\r\ndebug1: Reading configuration data /home/thom/.ssh/config\r\ndebug1: /home/thom/.ssh/config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256]\r\ndebug1: /home/thom/.ssh/config line 82: Applying options for homer\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Setting implicit ProxyCommand from ProxyJump: ssh -l twiggers -vvv -W '[%h]:%p' lilo.science.ru.nl\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 = 7302\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")
&lt;homer&gt; PUT /tmp/tmp3nwsZr TO /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/pacman.py
&lt;homer&gt; SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/thom/.ansible/cp/fdc2bea664 '[homer]'
&lt;homer&gt; (0, 'sftp&gt; put /tmp/tmp3nwsZr /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/pacman.py\n', 'OpenSSH_7.5p1, OpenSSL 1.1.0e  16 Feb 2017\r\ndebug1: Reading configuration data /home/thom/.ssh/config\r\ndebug1: /home/thom/.ssh/config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256]\r\ndebug1: /home/thom/.ssh/config line 82: Applying options for homer\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Setting implicit ProxyCommand from ProxyJump: ssh -l twiggers -vvv -W \'[%h]:%p\' lilo.science.ru.nl\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 = 7302\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 5 T:16 I:1\r\ndebug3: SSH_FXP_REALPATH . -&gt; /home/thom size 0\r\ndebug3: Looking up /tmp/tmp3nwsZr\r\ndebug3: Sent message fd 5 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:/home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/pacman.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:27437\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 5 27437 bytes at 32768\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')
&lt;homer&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;homer&gt; SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/thom/.ansible/cp/fdc2bea664 homer '/bin/sh -c '"'"'chmod u+x /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/ /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/pacman.py &amp;&amp; sleep 0'"'"''
&lt;homer&gt; (0, '', "OpenSSH_7.5p1, OpenSSL 1.1.0e  16 Feb 2017\r\ndebug1: Reading configuration data /home/thom/.ssh/config\r\ndebug1: /home/thom/.ssh/config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256]\r\ndebug1: /home/thom/.ssh/config line 82: Applying options for homer\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Setting implicit ProxyCommand from ProxyJump: ssh -l twiggers -vvv -W '[%h]:%p' lilo.science.ru.nl\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 = 7302\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")
&lt;homer&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;homer&gt; SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/thom/.ansible/cp/fdc2bea664 -tt homer '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-tixkiailijheyhbmsllbeczwqwdaiueq; /usr/bin/python /home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/pacman.py; rm -rf "/home/thom/.ansible/tmp/ansible-tmp-1493382410.32-244000386629474/" &gt; /dev/null 2&gt;&amp;1'"'"'"'"'"'"'"'"' &amp;&amp; sleep 0'"'"''
&lt;homer&gt; (0, 'Traceback (most recent call last):\r\n  File "/tmp/ansible_nbtluy_z/ansible_module_pacman.py", line 451, in &lt;module&gt;\r\n    main()\r\n  File "/tmp/ansible_nbtluy_z/ansible_module_pacman.py", line 443, in main\r\n    install_packages(module, pacman_path, p[\'state\'], pkgs, pkg_files)\r\n  File "/tmp/ansible_nbtluy_z/ansible_module_pacman.py", line 306, in install_packages\r\n    data = stdout.split(\'\\n\')[3].split(\' \')[2:]\r\nIndexError: list index out of range\r\n', "OpenSSH_7.5p1, OpenSSL 1.1.0e  16 Feb 2017\r\ndebug1: Reading configuration data /home/thom/.ssh/config\r\ndebug1: /home/thom/.ssh/config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256]\r\ndebug1: /home/thom/.ssh/config line 82: Applying options for homer\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Setting implicit ProxyCommand from ProxyJump: ssh -l twiggers -vvv -W '[%h]:%p' lilo.science.ru.nl\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 = 7302\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 131.174.12.215 closed.\r\n")
failed: [homer] (item=[u'ack', u'base-devel', u'clang', u'cmake', u'cronie', u'curl', u'git', u'htop', u'ltrace', u'ntp', u'openbsd-netcat', u'python', u'python-pip', u'python-virtualenv', u'python-virtualenvwrapper', u'python2', u'python2-pip', u'rsync', u'strace', u'svn', u'the_silver_searcher', u'tmux', u'valgrind', u'vim', u'wget', u'zsh']) =&gt; {
    "failed": true, 
    "item": [
        "ack", 
        "base-devel", 
        "clang", 
        "cmake", 
        "cronie", 
        "curl", 
        "git", 
        "htop", 
        "ltrace", 
        "ntp", 
        "openbsd-netcat", 
        "python", 
        "python-pip", 
        "python-virtualenv", 
        "python-virtualenvwrapper", 
        "python2", 
        "python2-pip", 
        "rsync", 
        "strace", 
        "svn", 
        "the_silver_searcher", 
        "tmux", 
        "valgrind", 
        "vim", 
        "wget", 
        "zsh"
    ], 
    "module_stderr": "OpenSSH_7.5p1, OpenSSL 1.1.0e  16 Feb 2017\r\ndebug1: Reading configuration data /home/thom/.ssh/config\r\ndebug1: /home/thom/.ssh/config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256]\r\ndebug1: /home/thom/.ssh/config line 82: Applying options for homer\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Setting implicit ProxyCommand from ProxyJump: ssh -l twiggers -vvv -W '[%h]:%p' lilo.science.ru.nl\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 = 7302\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 131.174.12.215 closed.\r\n", 
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_nbtluy_z/ansible_module_pacman.py\", line 451, in &lt;module&gt;\r\n    main()\r\n  File \"/tmp/ansible_nbtluy_z/ansible_module_pacman.py\", line 443, in main\r\n    install_packages(module, pacman_path, p['state'], pkgs, pkg_files)\r\n  File \"/tmp/ansible_nbtluy_z/ansible_module_pacman.py\", line 306, in install_packages\r\n    data = stdout.split('\\n')[3].split(' ')[2:]\r\nIndexError: list index out of range\r\n", 
    "msg": "MODULE FAILURE", 
    "rc": 0
}
</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<ul dir="auto">
<li>package</li>
<li>pacman</li>
</ul>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.0.0
  config file = /home/user/code/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.11 (default, Mar 20 2016, 15:46:50) [GCC 5.3.0]"><pre class="notranslate"><code class="notranslate">ansible 2.3.0.0
  config file = /home/user/code/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.11 (default, Mar 20 2016, 15:46:50) [GCC 5.3.0]
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">Host: Arch Linux<br>
Node: Arch Linux</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">The pacman and package modules fail with a Traceback when trying to install a non-existing package.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<ul dir="auto">
<li>A playbook with the following content:</li>
</ul>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="---
- hosts: all
  tasks:
    - name: Try to install a non-existing package
      package:
        name: thispackagedoesnotexist
        state: latest"><pre class="notranslate">---
- <span class="pl-ent">hosts</span>: <span class="pl-s">all</span>
  <span class="pl-ent">tasks</span>:
    - <span class="pl-ent">name</span>: <span class="pl-s">Try to install a non-existing package</span>
      <span class="pl-ent">package</span>:
        <span class="pl-ent">name</span>: <span class="pl-s">thispackagedoesnotexist</span>
        <span class="pl-ent">state</span>: <span class="pl-s">latest</span></pre></div>
<ul dir="auto">
<li>An inventory that references a single Arch Linux host.</li>
</ul>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">A warning/error message that the package does not exist.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible-playbook -i inventories/development.ini installtraceback.yml                                                                                                              
PLAY [all] ************************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************************************************************************************************
ok: [devel]

TASK [Try to install a non-existing package] **************************************************************************************************************************************************************************************************
fatal: [devel]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;failed&quot;: true, &quot;module_stderr&quot;: &quot;Shared connection to 192.168.122.125 closed.\r\n&quot;, &quot;module_stdout&quot;: &quot;Traceback (most recent call last):\r\n  File \&quot;/tmp/ansible_nQG_Kl/ansible_module_pacman.py\&quot;, line 451, in &lt;module&gt;\r\n    main()\r\n  File \&quot;/tmp/ansible_nQG_Kl/ansible_module_pacman.py\&quot;, line 443, in main\r\n    install_packages(module, pacman_path, p['state'], pkgs, pkg_files)\r\n  File \&quot;/tmp/ansible_nQG_Kl/ansible_module_pacman.py\&quot;, line 306, in install_packages\r\n    data = stdout.split('\\n')[3].split(' ')[2:]\r\nIndexError: list index out of range\r\n&quot;, &quot;msg&quot;: &quot;MODULE FAILURE&quot;, &quot;rc&quot;: 0}
        to retry, use: --limit @/home/user/code/ansible/installtraceback.retry

PLAY RECAP ************************************************************************************************************************************************************************************************************************************
devel            : ok=1    changed=0    unreachable=0    failed=1 "><pre class="notranslate"><code class="notranslate">$ ansible-playbook -i inventories/development.ini installtraceback.yml                                                                                                              
PLAY [all] ************************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************************************************************************************************
ok: [devel]

TASK [Try to install a non-existing package] **************************************************************************************************************************************************************************************************
fatal: [devel]: FAILED! =&gt; {"changed": false, "failed": true, "module_stderr": "Shared connection to 192.168.122.125 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_nQG_Kl/ansible_module_pacman.py\", line 451, in &lt;module&gt;\r\n    main()\r\n  File \"/tmp/ansible_nQG_Kl/ansible_module_pacman.py\", line 443, in main\r\n    install_packages(module, pacman_path, p['state'], pkgs, pkg_files)\r\n  File \"/tmp/ansible_nQG_Kl/ansible_module_pacman.py\", line 306, in install_packages\r\n    data = stdout.split('\\n')[3].split(' ')[2:]\r\nIndexError: list index out of range\r\n", "msg": "MODULE FAILURE", "rc": 0}
        to retry, use: --limit @/home/user/code/ansible/installtraceback.retry

PLAY RECAP ************************************************************************************************************************************************************************************************************************************
devel            : ok=1    changed=0    unreachable=0    failed=1 
</code></pre></div>