yum module not updating package when installing from local file

280 views
Skip to first unread message

Shay Rybak

unread,
Jun 7, 2016, 1:01:52 PM6/7/16
to Ansible Project
Hi,

I'm trying to build new versions of my code into rpm's then pushing them and install with ansible.

All stages up to the yum install work and I have my new version rpm in the local directory.

However when I run the yum command with the package name in the name parameter, the task is mared OK and the old version remains.

to be more clear.

installed package is <package_name>-1.0.0.noarch.rpm

the new package to be installed is <package_name>-1.0.1.noarch.rpm

But it does not install the 1.0.1 version.

When I run yum install <package_path>/<package_name>-1.0.1.noarch.rpm manually from the instance then the package is updated.

Is this a bug or is there some other way to do it which I'm missing.

Thanks

Adam Morris

unread,
Jun 7, 2016, 2:02:14 PM6/7/16
to Ansible Project
If you are just giving the package name (without a version) then the yum module will check if that is installed. It is so no task needs to be performed. If you were using a repository you would find no difference. If you were using a repository and set the state to latest it would update but that is not valid for a local package. Your best bet is to specify the full package name, with version (or use a repository)

Shay Rybak

unread,
Jun 8, 2016, 3:09:44 AM6/8/16
to Ansible Project
My issue is that even when stating full package name with version it does not update the package. 

Dick Davies

unread,
Jun 10, 2016, 11:03:47 AM6/10/16
to ansible list
It's probably time to show us the playbooks in question. This does
work for most people, it's
possible you have made some error.
> --
> 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/36d5a57e-2721-4f88-9bc3-b44b0c4f2a26%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Andrea C

unread,
Aug 29, 2016, 9:04:31 PM8/29/16
to Ansible Project, di...@hellooperator.net
I'm having this same problem...

What is your output? What's wierd is that in the output it doesn't even tell me that my RPM is already installed. It has blank results:
ok: [10.0.201.83] => {"changed": false, "msg": "", "rc": 0, "results": []}

Anyone have an idea how to fix this??

Shay Rybak

unread,
Aug 30, 2016, 10:14:55 AM8/30/16
to Ansible Project, di...@hellooperator.net
Hi,

I ended UP abandoning this because as far as I could see the rpm from file is only supported with state exists. you can't upgrade with it.

I remember I saw the feature request in Ansible forum somewhere but I can't find where.

Andrea C

unread,
Aug 31, 2016, 5:16:25 PM8/31/16
to Ansible Project, di...@hellooperator.net
Hmm, that's too bad. So you're just using the command module to do it manually?

It seems strange that it doesn't even say "package is already present." When I use the zypper module on SLES on the same RPM file, it at least gives me that feedback in the results.
Reply all
Reply to author
Forward
0 new messages