# Best Pattern for Installing RPMs

**URL:** <https://forum.ansible.com/t/best-pattern-for-installing-rpms/13096>\
**Category:** Ansible Project\
**Created:** [July 10, 2013, 10:43am UTC](https://forum.ansible.com/t/best-pattern-for-installing-rpms/13096 "2013-07-10T10:43:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Ni](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Michael\_Ni](https://forum.ansible.com/u/Michael_Ni)\
**Post date:** [July 10, 2013, 10:43am UTC](https://forum.ansible.com/t/best-pattern-for-installing-rpms/13096/1 "2013-07-10T10:43:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 10, 2013, 8:55pm UTC](https://forum.ansible.com/t/best-pattern-for-installing-rpms/13096/2 "2013-07-10T20:55:58Z")

</div>

“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.
