<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.6.6</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Host OS: OSX 10.9.4<br>
Target OS: Oracle Linux Server release 6.5</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Installing a package with the yum module and option 'enablerepo' with 2 repo's fails with the message:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="failed: [localhost] =&gt; {&quot;failed&quot;: true}
msg: Error setting/accessing repo puppetlabs-deps: Error getting repository data for puppetlabs-deps, repository not found"><pre class="notranslate"><code class="notranslate">failed: [localhost] =&gt; {"failed": true}
msg: Error setting/accessing repo puppetlabs-deps: Error getting repository data for puppetlabs-deps, repository not found
</code></pre></div>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">After adding a new repo file to the /etc/yum.repos.d directory with all repo's in there disabled, this snippet is used to install the package:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: Install puppet-server package
  yum:
    name=puppet-server
    enablerepo=puppetlabs-products,puppetlabs-deps"><pre class="notranslate"><code class="notranslate">- name: Install puppet-server package
  yum:
    name=puppet-server
    enablerepo=puppetlabs-products,puppetlabs-deps
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">The package is installed</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">The error described above is shown.<br>
This works fine on CentOS 6.5</p>
<p dir="auto">The yum module splits the enablerepo values and generates multiple <code class="notranslate">--enablerepo</code> tags. This works fine on CentOS 6.5 but not on Oracle Linux 6.5. For Oracle Linux only one <code class="notranslate">--enablerepo</code> must be specified where multiple repo's must be separated with a comma.</p>
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">"Bug Report:"</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.4.3, 1.5.3</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Oracle Enterprise Linux 6.4</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">yum module enablerepo won't do multiple repositories</p>
<h5 dir="auto">Steps to Reproduce:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible server1 -s -K -m yum -a &quot;name=pkgname enablerepo=repo1,repo2 state=latest&quot;"><pre class="notranslate"><code class="notranslate">ansible server1 -s -K -m yum -a "name=pkgname enablerepo=repo1,repo2 state=latest"
</code></pre></div>
<p dir="auto">repo1 and repo2 are intentionally disabled by default in the yum.repo.d configuration files and are enabled as required when installing packages</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[repo1]
name=Repository 1
baseurl=http://reposerver/repository1
gpgkey=http://reposerver//RPM-GPG-KEY-repo1
gpgcheck=1
enabled=0

[repo2]
name=Repository 2
baseurl=http://reposerver/repository2
gpgkey=http://reposerver//RPM-GPG-KEY-repo2
gpgcheck=1
enabled=0"><pre class="notranslate"><code class="notranslate">[repo1]
name=Repository 1
baseurl=http://reposerver/repository1
gpgkey=http://reposerver//RPM-GPG-KEY-repo1
gpgcheck=1
enabled=0

[repo2]
name=Repository 2
baseurl=http://reposerver/repository2
gpgkey=http://reposerver//RPM-GPG-KEY-repo2
gpgcheck=1
enabled=0
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">The specified package and any dependencies it requires are successfully installed on the target servers.</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">ansible on the Ansible server outputs that it cannot find repository data for the second specified repository (repo2).  Swapping the order of the repository names in the command line simply changes which repository data cannot be located.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="server1 | FAILED &gt;&gt; {
    &quot;failed&quot;: true,
    &quot;msg&quot;: &quot;Error setting/accessing repo repo2: Error getting repository data for repo2, repository not found&quot;"><pre class="notranslate"><code class="notranslate">server1 | FAILED &gt;&gt; {
    "failed": true,
    "msg": "Error setting/accessing repo repo2: Error getting repository data for repo2, repository not found"
</code></pre></div>
<p dir="auto">If I run ansible with '-vvv', the following is output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;server1&gt; ESTABLISH CONNECTION FOR USER: ansible on PORT 22 TO server1
&lt;server1&gt; REMOTE_MODULE yum name=ansible enablerepo=repo1,repo2 state=latest
&lt;server1&gt; EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236'
&lt;server1&gt; PUT /tmp/tmpqjd93P TO /home/ansible/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236/yum
&lt;server1&gt; EXEC /bin/sh -c 'sudo -k &amp;&amp; sudo -H -S -p &quot;[sudo via ansible, key=ymortmfovnpsvcpoojkrmqfchlzqzlfm] password: &quot; -u root /bin/sh -c '&quot;'&quot;'echo SUDO-SUCCESS-ymortmfovnpsvcpoojkrmqfchlzqzlfm; /usr/bin/python -tt /home/server1/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236/yum; rm -rf /home/server1/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236/ &gt;/dev/null 2&gt;&amp;1'&quot;'&quot;''

I have checked the log files on the repository server and used tcpdump to monitor traffic to and from the target server and I can see that the yum module is never reaching out to the repository server.  It appears to be stuck at reading the yum.repos.d configuration files.

I have five Ansible servers, each in different data centers, I get the same results on on all five servers.  I have tried different packages and different repositories, and it is always the same: the yum module fails on the second repository."><pre class="notranslate"><code class="notranslate">&lt;server1&gt; ESTABLISH CONNECTION FOR USER: ansible on PORT 22 TO server1
&lt;server1&gt; REMOTE_MODULE yum name=ansible enablerepo=repo1,repo2 state=latest
&lt;server1&gt; EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236'
&lt;server1&gt; PUT /tmp/tmpqjd93P TO /home/ansible/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236/yum
&lt;server1&gt; EXEC /bin/sh -c 'sudo -k &amp;&amp; sudo -H -S -p "[sudo via ansible, key=ymortmfovnpsvcpoojkrmqfchlzqzlfm] password: " -u root /bin/sh -c '"'"'echo SUDO-SUCCESS-ymortmfovnpsvcpoojkrmqfchlzqzlfm; /usr/bin/python -tt /home/server1/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236/yum; rm -rf /home/server1/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236/ &gt;/dev/null 2&gt;&amp;1'"'"''

I have checked the log files on the repository server and used tcpdump to monitor traffic to and from the target server and I can see that the yum module is never reaching out to the repository server.  It appears to be stuck at reading the yum.repos.d configuration files.

I have five Ansible servers, each in different data centers, I get the same results on on all five servers.  I have tried different packages and different repositories, and it is always the same: the yum module fails on the second repository.
</code></pre></div>