Module yum: update revision

26 views
Skip to first unread message

Ricardo Ferreira

unread,
Mar 8, 2019, 1:41:13 PM3/8/19
to Ansible Project
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?

Soniya panwar

unread,
Apr 4, 2019, 6:20:51 AM4/4/19
to Ansible Project
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
Reply all
Reply to author
Forward
0 new messages