Best Pattern for Installing RPMs

I’m new to Ansible so forgive me if I sound newbish.

Ansible includes a yum module that works great.

If I want to hand pick my rpms and install them, what is the best pattern to do so?

By the way I’m on CentOS

I can only think of 2 solutions and was wondering if anyone had a better solution

1.) create a yum repo (local or hosted) and use the yum module

or

2.) write a playbook that will check if rpms are installed, if not download the rpm and install it.

the problem with the first solution is, I will want to use custom rpms to create my yum repo with ansible. It is a chicken vs egg problem.

regarding the second solution, I haven’t see anyone doing it that way. I want to keep my scripts 100% idempotent.

Does anyone have any ideas?

Mike

“If I want to hand pick my rpms and install them, what is the best pattern to do so?”

Create a local yum repo of those RPMs is the bestest way, and is super easy.

mkdir directory

createrepo directory
make directory web accessible
configure in yum.repos.d

Obviously you could use get_url + shell calling the RPM, but yum is so much better for this.