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


On Saturday, March 9, 2019 at 12:11:13 AM UTC+5:30, Ricardo Ferreira wrote:
>
> 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?
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5061ae89-4da7-44c2-900f-d10ed974df4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to