<p dir="auto">This is a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="225066856" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/24110" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/24110/hovercard" href="https://github.com/ansible/ansible/issues/24110">#24110</a> but that issue is closed and nobody seems to be willing to open it (I even asked in #ansible).</p>
<h5 dir="auto">ISSUE TYPE</h5>

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

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible-playbook 2.4.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/thom/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.14 (default, Sep 20 2017, 01:25:59) [GCC 7.2.0]"><pre class="notranslate"><code class="notranslate">ansible-playbook 2.4.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/thom/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.14 (default, Sep 20 2017, 01:25:59) [GCC 7.2.0]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Arch Linux</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Pacman supports aliases when searching or installing package names, but doesn't support them when querying package's installed states. This crashes the Ansible <code class="notranslate">pacman</code> module.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>

<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- hosts: localhost
  become: yes
  tasks:
    - pacman: name=svn state=present"><pre class="notranslate">- <span class="pl-ent">hosts</span>: <span class="pl-s">localhost</span>
  <span class="pl-ent">become</span>: <span class="pl-s">yes</span>
  <span class="pl-ent">tasks</span>:
    - <span class="pl-ent">pacman</span>: <span class="pl-s">name=svn state=present</span></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Show that subversion is already installed</p>
<h5 dir="auto">ACTUAL RESULTS</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="task path: /home/thom/git/ansible/test.yml:4
Using module file /usr/lib/python2.7/site-packages/ansible/modules/packaging/os/pacman.py
&lt;127.0.0.1&gt; ESTABLISH LOCAL CONNECTION FOR USER: thom
&lt;127.0.0.1&gt; EXEC /bin/sh -c 'echo ~ &amp;&amp; sleep 0'
&lt;127.0.0.1&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p &quot;` echo /home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425 `&quot; &amp;&amp; echo ansible-tmp-1510228510.14-193730463357425=&quot;` echo /home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425 `&quot; ) &amp;&amp; sleep 0'
&lt;127.0.0.1&gt; PUT /tmp/tmpO43qZY TO /home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425/pacman.py
&lt;127.0.0.1&gt; EXEC /bin/sh -c 'chmod u+x /home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425/ /home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425/pacman.py &amp;&amp; sleep 0'
&lt;127.0.0.1&gt; EXEC /bin/sh -c 'sudo -H -S  -p &quot;[sudo via ansible, key=piygkrwrgcualemppeyqvtcebrddppaq] password: &quot; -u root /bin/sh -c '&quot;'&quot;'echo BECOME-SUCCESS-piygkrwrgcualemppeyqvtcebrddppaq; /usr/bin/python2 /home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425/pacman.py; rm -rf &quot;/home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425/&quot; &gt; /dev/null 2&gt;&amp;1'&quot;'&quot;' &amp;&amp; sleep 0'
The full traceback is:
Traceback (most recent call last):
  File &quot;/tmp/ansible_VEhXK5/ansible_module_pacman.py&quot;, line 444, in &lt;module&gt;
    main()
  File &quot;/tmp/ansible_VEhXK5/ansible_module_pacman.py&quot;, line 436, in main
    install_packages(module, pacman_path, p['state'], pkgs, pkg_files)
  File &quot;/tmp/ansible_VEhXK5/ansible_module_pacman.py&quot;, line 298, in install_packages
    data = stdout.split('\n')[3].split(' ')[2:]
IndexError: list index out of range

fatal: [localhost]: FAILED! =&gt; {
    &quot;changed&quot;: false, 
    &quot;failed&quot;: true, 
    &quot;module_stderr&quot;: &quot;Traceback (most recent call last):\n  File \&quot;/tmp/ansible_VEhXK5/ansible_module_pacman.py\&quot;, line 444, in &lt;module&gt;\n    main()\n  File \&quot;/tmp/ansible_VEhXK5/ansible_module_pacman.py\&quot;, line 436, in main\n    install_packages(module, pacman_path, p['state'], pkgs, pkg_files)\n  File \&quot;/tmp/ansible_VEhXK5/ansible_module_pacman.py\&quot;, line 298, in install_packages\n    data = stdout.split('\\n')[3].split(' ')[2:]\nIndexError: list index out of range\n&quot;, 
    &quot;module_stdout&quot;: &quot;&quot;, 
    &quot;msg&quot;: &quot;MODULE FAILURE&quot;, 
    &quot;rc&quot;: 0
}"><pre class="notranslate"><code class="notranslate">task path: /home/thom/git/ansible/test.yml:4
Using module file /usr/lib/python2.7/site-packages/ansible/modules/packaging/os/pacman.py
&lt;127.0.0.1&gt; ESTABLISH LOCAL CONNECTION FOR USER: thom
&lt;127.0.0.1&gt; EXEC /bin/sh -c 'echo ~ &amp;&amp; sleep 0'
&lt;127.0.0.1&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p "` echo /home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425 `" &amp;&amp; echo ansible-tmp-1510228510.14-193730463357425="` echo /home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425 `" ) &amp;&amp; sleep 0'
&lt;127.0.0.1&gt; PUT /tmp/tmpO43qZY TO /home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425/pacman.py
&lt;127.0.0.1&gt; EXEC /bin/sh -c 'chmod u+x /home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425/ /home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425/pacman.py &amp;&amp; sleep 0'
&lt;127.0.0.1&gt; EXEC /bin/sh -c 'sudo -H -S  -p "[sudo via ansible, key=piygkrwrgcualemppeyqvtcebrddppaq] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-piygkrwrgcualemppeyqvtcebrddppaq; /usr/bin/python2 /home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425/pacman.py; rm -rf "/home/thom/.ansible/tmp/ansible-tmp-1510228510.14-193730463357425/" &gt; /dev/null 2&gt;&amp;1'"'"' &amp;&amp; sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_VEhXK5/ansible_module_pacman.py", line 444, in &lt;module&gt;
    main()
  File "/tmp/ansible_VEhXK5/ansible_module_pacman.py", line 436, in main
    install_packages(module, pacman_path, p['state'], pkgs, pkg_files)
  File "/tmp/ansible_VEhXK5/ansible_module_pacman.py", line 298, in install_packages
    data = stdout.split('\n')[3].split(' ')[2:]
IndexError: list index out of range

fatal: [localhost]: FAILED! =&gt; {
    "changed": false, 
    "failed": true, 
    "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_VEhXK5/ansible_module_pacman.py\", line 444, in &lt;module&gt;\n    main()\n  File \"/tmp/ansible_VEhXK5/ansible_module_pacman.py\", line 436, in main\n    install_packages(module, pacman_path, p['state'], pkgs, pkg_files)\n  File \"/tmp/ansible_VEhXK5/ansible_module_pacman.py\", line 298, in install_packages\n    data = stdout.split('\\n')[3].split(' ')[2:]\nIndexError: list index out of range\n", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE", 
    "rc": 0
}
</code></pre></div>
<p dir="auto">See also <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="225066856" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/24110" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/24110/hovercard" href="https://github.com/ansible/ansible/issues/24110">#24110</a></p>
<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>