Install Yum Repo

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

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.

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