Installing redis from RPM

I’m working on a simple playbook to install redis from the remi repo. When I do this manually on the target server I do the following:

  • wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm

  • sudo rpm -Uvh remi-release-6.rpm

  • sudo vim /etc/yum.repos.d/remi.repo #to mark the repo as enabled

  • sudo yum install redis

  • sudo chkconfig redis on

  • sudo service redis start
    I think I have most of the stuff figured out like starting the service and installing via yum once the repo is installed. Just wondering how I can automated installing the rpm from the URL and setting the repo to enabled.

I’ll continue playing with it but wanted to ask for a little guidance since it’s been a year + since I’ve worked with Ansible.

Thanks folks!

Ok so I figured how how to get the RPM/repo installed. This is my playbook so far

Try to use “yumrepo” module to enable yum repository.

Thanks, I did some digging and figured it out. This playbook takes care of everything now, just had to do a little digging on enabling the repo via yum.

with:

   service: name=redis state=started enabled=yes

you don't need to call chkconfig