Hey,
I'd recommend you read fully through the '
Getting Started'
guide, and carry on reading through the other docs - reading these and
implementing/playing with what they teach is the quickest, most
efficient way to learn.
That said, if the RPMs you're talking
about are hosted in a repository, you can use the 'yum' module (or
'package', if you're running Ansible 2.0 - not yet released).
See
here for the yum modules documentation, it has a 'state' value.
Setting this to 'latest' would do what you're wanting to achieve, like so:
- name: Ensure packages are installed and the latest available version
yum: name=some_package state=latest
Or, for a list of packages:
- name: Ensure packages are installed and the latest available version
yum: name="{{ item }}" state=latest
with_items:
- some_package
- some_other_package
- a_third_package
This example shows
iterating over a list of values, using 'with_items'.Hope this helps - make sure you read through the docs and try and learn these things yourself :)
Kind Regards,
Calum