# Install Yum Repo

**URL:** <https://forum.ansible.com/t/install-yum-repo/16865>\
**Category:** Ansible Project\
**Created:** [November 25, 2014, 12:37am UTC](https://forum.ansible.com/t/install-yum-repo/16865 "2014-11-25T00:37:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ovidio\_B](https://avatars.discourse-cdn.com/v4/letter/o/e79b87/32.png) [@Ovidio\_B](https://forum.ansible.com/u/Ovidio_B)\
**Post date:** [November 25, 2014, 12:37am UTC](https://forum.ansible.com/t/install-yum-repo/16865/1 "2014-11-25T00:37:17Z")

</div>

Greetings,

I’m very new to ansible and I created this simple playbook to install new relic, however I’m trying to see if there’s a way for the first task to see if the RPM is present. New Relic’s documenation has me installing the repo with the following command: “rpm -Uvh [http://download.newrelic.com/pub/newrelic/el5/i386/newrelic-repo-5-3.noarch.rpm](http://download.newrelic.com/pub/newrelic/el5/i386/newrelic-repo-5-3.noarch.rpm)”

Is there a way I can use the Yum module to check to see if the repo was already installed so the playbook doens’t fail instead of using the command module? I was thinking maybe enablerepo would do the trick but i’m not 100% certain.

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [November 25, 2014, 11:14pm UTC](https://forum.ansible.com/t/install-yum-repo/16865/2 "2014-11-25T23:14:57Z")

</div>

yum: can take a URL, or alternatively you can download the file  
(preferably using get\_url which is easy to make idempotent)  
and then pass yum: the downloaded path to the RPM.

Cheers  
Dick
