Issue 1:
Issue Type:

Bug Report

Ansible Version:

ansible 1.6.6

Environment:

Host OS: OSX 10.9.4

Target OS: Oracle Linux Server release 6.5

Summary:

Installing a package with the yum module and option 'enablerepo' with 2 repo's fails with the message:

failed: [localhost] => {"failed": true}
msg: Error setting/accessing repo puppetlabs-deps: Error getting repository data for puppetlabs-deps, repository not found

Steps To Reproduce:

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:

- name: Install puppet-server package
yum:
name=puppet-server
enablerepo=puppetlabs-products,puppetlabs-deps

Expected Results:

The package is installed

Actual Results:

The error described above is shown.

This works fine on CentOS 6.5

The yum module splits the enablerepo values and generates multiple --enablerepo tags. This works fine on CentOS 6.5 but not on Oracle Linux 6.5. For Oracle Linux only one --enablerepo must be specified where multiple repo's must be separated with a comma.

Issue 2:
Issue Type:

"Bug Report:"

Ansible Version:

ansible 1.4.3, 1.5.3

Environment:

Oracle Enterprise Linux 6.4

Summary:

yum module enablerepo won't do multiple repositories

Steps to Reproduce:

ansible server1 -s -K -m yum -a "name=pkgname enablerepo=repo1,repo2 state=latest"

repo1 and repo2 are intentionally disabled by default in the yum.repo.d configuration files and are enabled as required when installing packages

[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

Expected Results:

The specified package and any dependencies it requires are successfully installed on the target servers.

Actual Results:

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.

server1 | FAILED >> {
"failed": true,
"msg": "Error setting/accessing repo repo2: Error getting repository data for repo2, repository not found"

If I run ansible with '-vvv', the following is output:

<server1> ESTABLISH CONNECTION FOR USER: ansible on PORT 22 TO server1
<server1> REMOTE_MODULE yum name=ansible enablerepo=repo1,repo2 state=latest
<server1> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236 && echo $HOME/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236'
<server1> PUT /tmp/tmpqjd93P TO /home/ansible/.ansible/tmp/ansible-tmp-1398273878.46-183006336271236/yum
<server1> EXEC /bin/sh -c 'sudo -k && 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/ >/dev/null 2>&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.