I still have not been able to replicate this. Taking all the things
that people have said on this list I just ran a test on a centos6
host:
$ cat /etc/redhat-release
(15:20:34)
CentOS release 6.6 (Final)
with ansible-1.9.2 from the epel repository.
[pts/0@rhel6 ~]$ rpm -q ansible
(15:21:01)
ansible-1.9.2-1.el6.noarch
[pts/0@rhel6 ~]$ ansible --version
(15:21:06)
[WARNING]: The version of gmp you have installed has a known issue regarding
timing vulnerabilities when used with pycrypto. If possible, you should update
it (i.e. yum update gmp).
ansible 1.9.2
configured module search path = None
I have a repository that is unreachable enabled in /etc/yum.repos.d:
[pts/0@rhel6 ~]$ cat /etc/yum.repos.d/broken.repo
(15:21:37)
[broken]
name=Broken
baseurl=
http://download.fedoraproject.org/broken
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[pts/0@rhel6 ~]$ sudo yum install -y python-q
(15:22:08)
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base:
mirror.lax.hugeserver.com
* epel:
linux.mirrors.es.net
* extras:
mirrors.psychz.net
* updates:
centos.mirrors.hoobly.com
http://download.fedoraproject.org/broken/repodata/repomd.xml: [Errno
14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not
Found"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for
repository: broken. Please verify its path and try again
The playbook seems to contain all the same pieces (including use of
wildcards in both disable and enablerepo):
[pts/0@rhel6 ~]$ cat yum.yml
(15:26:51)
---
- hosts: localhost
tasks:
- yum: name=python-q state=absent
- yum: name={{item}} disablerepo=* enablerepo=e* state=present
with_items:
- python-q
But my run succeeds:
[pts/0@rhel6 ~]$ ansible-playbook yum.yml --sudo -K -v
(15:24:48)
[WARNING]: The version of gmp you have installed has a known issue regarding
timing vulnerabilities when used with pycrypto. If possible, you should update
it (i.e. yum update gmp).
SUDO password:
PLAY [localhost] **************************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [yum name=python-q state=absent] ****************************************
changed: [localhost] => {"changed": true, "msg": "", "rc": 0,
"results": ["Loaded plugins: fastestmirror\nSetting up Remove
Process\nResolving Dependencies\n--> Running transaction check\n--->
Package python-q.noarch 0:2.5-2.el6 will be erased\n--> Finished
Dependency Resolution\n\nDependencies
Resolved\n\n================================================================================\n
Package Arch Version Repository
Size\n================================================================================\nRemoving:\n
python-q noarch 2.5-2.el6 @epel
28 k\n\nTransaction
Summary\n================================================================================\nRemove
1 Package(s)\n\nInstalled size: 28 k\nDownloading
Packages:\nRunning rpm_check_debug\nRunning Transaction
Test\nTransaction Test Succeeded\nRunning Transaction\n\r Erasing
: python-q-2.5-2.el6.noarch 1/1
\n\r Verifying : python-q-2.5-2.el6.noarch
1/1 \n\nRemoved:\n python-q.noarch 0:2.5-2.el6
\n\nComplete!\n"]}
TASK: [yum name={{item}} disablerepo=* enablerepo=e* state=present] ***********
changed: [localhost] => (item=python-q) => {"changed": true, "item":
"python-q", "msg": "", "rc": 0, "results": ["Loaded plugins:
fastestmirror\nSetting up Install Process\nLoading mirror speeds from
cached hostfile\n * epel:
linux.mirrors.es.net\n * epel-debuginfo:
linux.mirrors.es.net\n * epel-source:
linux.mirrors.es.net\n *
epel-testing:
linux.mirrors.es.net\n * epel-testing-debuginfo:
linux.mirrors.es.net\n * epel-testing-source:
linux.mirrors.es.net\n *
extras:
mirrors.tummy.com\nResolving Dependencies\n--> Running
transaction check\n---> Package python-q.noarch 0:2.5-2.el6 will be
installed\n--> Finished Dependency Resolution\n\nDependencies
Resolved\n\n================================================================================\n
Package Arch Version Repository
Size\n================================================================================\nInstalling:\n
python-q noarch 2.5-2.el6 epel
15 k\n\nTransaction
Summary\n================================================================================\nInstall
1 Package(s)\n\nTotal download size: 15 k\nInstalled size: 28
k\nDownloading Packages:\nRunning rpm_check_debug\nRunning Transaction
Test\nTransaction Test Succeeded\nRunning Transaction\n\r Installing
: python-q-2.5-2.el6.noarch 1/1
\n\r Verifying : python-q-2.5-2.el6.noarch
1/1 \n\nInstalled:\n python-q.noarch 0:2.5-2.el6
\n\nComplete!\n"]}
PLAY RECAP ********************************************************************
localhost : ok=3 changed=2 unreachable=0 failed=0
If you'd care to try my playbook and see if it works, perhaps that
will help to narrow down where your problem is coming from.
-Toshio
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
ansible-proje...@googlegroups.com.
> To post to this group, send email to
ansible...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/75776e4b-7894-4942-9a78-e1a2823f8e62%40googlegroups.com.
>
> For more options, visit
https://groups.google.com/d/optout.