On Thu, Oct 15, 2015 at 12:50 AM, Guillaume Belrose <kafe...@gmail.com> wrote:
> Hi all,
>
> I am using Ansible 1.9.2 on CentOS 6.7. I am designing a system which can
> deploy software onto machines when those machines don't have access to the
> Internet. I basically have an Ansible controller node with cached RPMs and a
> web server. On each target node, I have defined a .repo file to instruct
> each node to fetch the rpms from the web server.
>
> When I do the deployment, I am finding that the yum module does not work.
>
> For example, executing the following task fails:
>
> - name: install the MySQL-python package
>
>   yum: disablerepo=* enablerepo=ansible name=MySQL-python
>
>
> The error message is:
>
>
> TASK: [icingaweb2 | install the MySQL-python package]
> *************************
>
> failed: [192.168.50.201] => {"changed": false, "failed": true, "rc": 0,
> "results": []}
>
> msg: No Package matching 'MySQL-python' found available, installed or
> updated
>
>
> FATAL: all hosts have already failed -- aborting
>
>
> However if I use the yum command via an Ansible shell, the package is
> installed correctly:
>
>
> - name: install the MySQL-python package
>
>   shell: yum -y --disablerepo=* --enablerepo=ansible install MySQL-python
>
>
> I was wondering if I am not using the yum module correctly or if this is an
> Ansible bug.
>
>

Your playbook looks correct but I am unable to reproduce your problem
with Fedora 21 and ansible-1.9.3-2 from the Fedora packages:

---
- hosts: localhost
  tasks:
    - yum: disablerepo=* enablerepo=updates name=python-q

$ ansible-playbook yum.yml --sudo -K  *[stable-1.9]  (14:28:08)
SUDO password:

PLAY [localhost] **************************************************************

GATHERING FACTS ***************************************************************
ok: [localhost]

TASK: [yum disablerepo=* enablerepo=updates name=python-q] ********************
changed: [localhost]

PLAY RECAP ********************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0

[pts/19@roan /srv/ansible/stable/lib/ansible/modules]$ rpm -q python-q
                    *[stable-1.9]  (14:28:27)
python-q-2.5-2.fc21.noarch


There were some bugs in the yum module that were fixed in 1.93 and
more that were fixed in 1.9.4.  Perhaps you could try the
ansible-1.9.4 packages from the EPEL testing repository and see if the
behaviour is still the same?

https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-1ba9b07c1e

-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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAG9juEoQO%3DyWpOzboqS_m0FEC07V9f58MhYMFu-Q9Q7VdSugCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to