I am creating some unit tests for my ansible role(OS update) to verify that my os update process has been done successfully. There is a feature to update only security related packages.

To test it, I need to downgrade or install a package (with a security related update) beforehand. And later, after executing the role, I will verify that this update has been installed.

Any recommendation on how to tackle such issue? new ideas are welcomed.

OS: CentOS 7

1 Answer 1


You’re nearly there. “yum downgrade package name” will install the previous package available in the yum repo. You can also point it at a package ( or packages) if you have them downloaded already.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.