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.  

---
- name: 1. Add the New Relic yum repository
  command: rpm -Uvh 
http://download.newrelic.com/pub/newrelic/el5/i386/newrelic-repo-5-3.noarch.rpm
  
- name: 2. Install the Server Monitor package
  yum: name=newrelic-sysmond state=latest

- name: 3. Configure & start the Server Monitor daemon
  command: "{{item}}"
  with_items:
  - nrsysmond-config --set 
license_key=a58da0ed3e1daf8e9f5a9573a5f295cdb332ef20
  - /etc/init.d/newrelic-sysmond start

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/670466f2-06e4-4428-9490-dacf00b23320%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to