<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.7</p>
<h5 dir="auto">Environment:</h5>
<ul dir="auto">
<li>client: Arch Linux</li>
<li>server: Ubuntu 14.04, ssh as root user without sudo.</li>
</ul>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Before upgrading from 1.6.6, <code class="notranslate">unarchive</code> would extract files in a second. After the upgrade, the client takes a full CPU core for 7 minutes to extract 7k+ files.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">The tasks file is pretty basic:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# run as ssh user root, without sudo
- name: copy and extract app tarball
  unarchive: src={{app_tarball}}
             dest={{tarball_dest_dirname}}"><pre class="notranslate"><code class="notranslate"># run as ssh user root, without sudo
- name: copy and extract app tarball
  unarchive: src={{app_tarball}}
             dest={{tarball_dest_dirname}}
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">Instant execution in a few seconds.</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">It takes 7 minutes while hogging a full CPU core. A gdb backtrace showed a trace where the output of <code class="notranslate">tar --diff</code> gets concatenated.</p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">rpm_key<br>
yum_repository</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.0.0
  config file =
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.2.0.0
  config file =
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">No changes</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Running from MacOS, installing in a Centos 7 VM.</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">After I run <code class="notranslate">yum_repository</code> and <code class="notranslate">rpm_key</code> to add a yum repository and (presumably) import its GPG key, I still can't install package from the repository because <code class="notranslate">yum</code> complains that it can't verify its <code class="notranslate">respond.xml</code>: <code class="notranslate">Gpg Keys not imported, cannot verify repomd.xml for repo {...}</code>.</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="    - name: add Grafana repository
      yum_repository:
        name: grafana
        description: Grafana YUM repo
        baseurl: https://packagecloud.io/grafana/stable/el/$releasever/$basearch/
        gpgcheck: yes
        repo_gpgcheck: yes
        gpgkey: https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
        sslverify: yes
        sslcacert: /etc/pki/tls/certs/ca-bundle.crt

    - name: add the repository keys
      rpm_key:
        key: &quot;{{ item }}&quot;
        state: present
      with_items:
        - https://packagecloud.io/gpg.key
        - https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana

    - name: install Grafana package
      yum: name=grafana"><pre class="notranslate">    - <span class="pl-ent">name</span>: <span class="pl-s">add Grafana repository</span>
      <span class="pl-ent">yum_repository</span>:
        <span class="pl-ent">name</span>: <span class="pl-s">grafana</span>
        <span class="pl-ent">description</span>: <span class="pl-s">Grafana YUM repo</span>
        <span class="pl-ent">baseurl</span>: <span class="pl-s">https://packagecloud.io/grafana/stable/el/$releasever/$basearch/</span>
        <span class="pl-ent">gpgcheck</span>: <span class="pl-s">yes</span>
        <span class="pl-ent">repo_gpgcheck</span>: <span class="pl-s">yes</span>
        <span class="pl-ent">gpgkey</span>: <span class="pl-s">https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana</span>
        <span class="pl-ent">sslverify</span>: <span class="pl-s">yes</span>
        <span class="pl-ent">sslcacert</span>: <span class="pl-s">/etc/pki/tls/certs/ca-bundle.crt</span>

    - <span class="pl-ent">name</span>: <span class="pl-s">add the repository keys</span>
      <span class="pl-ent">rpm_key</span>:
        <span class="pl-ent">key</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ item }}<span class="pl-pds">"</span></span>
        <span class="pl-ent">state</span>: <span class="pl-s">present</span>
      <span class="pl-ent">with_items</span>:
        - <span class="pl-s">https://packagecloud.io/gpg.key</span>
        - <span class="pl-s">https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana</span>

    - <span class="pl-ent">name</span>: <span class="pl-s">install Grafana package</span>
      <span class="pl-ent">yum</span>: <span class="pl-s">name=grafana</span></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Package <code class="notranslate">grafana</code> is installed.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [add Grafana repository] **************************************************
ok: [node0.vagrant.test] =&gt; {&quot;changed&quot;: false, &quot;repo&quot;: &quot;grafana&quot;, &quot;state&quot;: &quot;present&quot;}

TASK [add the repository keys] *************************************************
ok: [node0.vagrant.test] =&gt; (item=https://packagecloud.io/gpg.key) =&gt; {&quot;changed&quot;: false, &quot;item&quot;: &quot;https://packagecloud.io/gpg.key&quot;}
ok: [node0.vagrant.test] =&gt; (item=https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana) =&gt; {&quot;changed&quot;: false, &quot;item&quot;: &quot;https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana&quot;}

TASK [install Grafana package] *************************************************
fatal: [node0.vagrant.test]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;failed&quot;: true, &quot;msg&quot;: &quot;Failure talking to yum: failure: repodata/repomd.xml from grafana: [Errno 256] No more mirrors to try.\nhttps://packagecloud.io/grafana/stable/el/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for grafana&quot;}"><pre class="notranslate"><code class="notranslate">TASK [add Grafana repository] **************************************************
ok: [node0.vagrant.test] =&gt; {"changed": false, "repo": "grafana", "state": "present"}

TASK [add the repository keys] *************************************************
ok: [node0.vagrant.test] =&gt; (item=https://packagecloud.io/gpg.key) =&gt; {"changed": false, "item": "https://packagecloud.io/gpg.key"}
ok: [node0.vagrant.test] =&gt; (item=https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana) =&gt; {"changed": false, "item": "https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana"}

TASK [install Grafana package] *************************************************
fatal: [node0.vagrant.test]: FAILED! =&gt; {"changed": false, "failed": true, "msg": "Failure talking to yum: failure: repodata/repomd.xml from grafana: [Errno 256] No more mirrors to try.\nhttps://packagecloud.io/grafana/stable/el/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for grafana"}
</code></pre></div>