Module yum: update revision

Hi all,

I need to update a list of packages but to a new revision inside a version.
If I use state latest the yum module just ignore the version and install the latest version avaliable.
If I use the state present and the system have already this version installed nothing is done.

for example:
List of version avaliable:

my-rpm1-1.2.0-r123 (Installed)
my-rpm1-1.2.0-r130

my-rpm1-1.3.0-1

I want update to ‘my-rpm1-1.2.0-r130’

if I run the following task the version 1.3.0 will be installed, But I need to install the version ‘1.2.0-r130’

  • name: install rpm
    yum: name=“{{ item }}” state=latest
    become: yes
    with_items:
  • my-rpm1-1.2.0

Anyone knows How to solver this problem?

Hello Ricardo,

You can not update the version to its latest revision using “state= latest”. State “latest” will update the specified package if it’s not of the latest available version. In your case, it will update your package to the latest available version which is “my-rpm1-1.3.0-1”.
To perform updation to a perticular revision, you need to use “state=present” and specify the desired version revision as shown in the below code snippet.

  • name: install rpm
    yum: name=“{{ item }}” state=present
    become: yes
    with_items:
  • my-rpm1-1.2.0-r130

Thanks
Soniya