I have an rpm of my application. I'm using ansible to deploy and install the rpm on multiple services. In case the rpm install fails, I want to keep only the previous rpm version that was installed. For example, if I install rpm v15 and afterwards v18 and v18 fails, I want to keep v15 and revert the changes of v18 install.
When using rpm I can easily install multiple versions of the same rpms with the following command :
rpm -ihv --oldpackage my-rpm-18.rpm
Is there a way to do it with yum module in ansible ?