ansible role for redis server5 min read
Hi Readers, this document deals with how to setup ansible role for redis server.
Ansible is open source software that automates software provisioning, configuration management, and application deployment. Ansible connects via SSH, remote PowerShell or via other remote APIs.
If you haven’t installed Ansible check here/
Here is the setup.
Step 1: initialize role set up for Redis server using ansible galaxy
once the command is executed, folder structures are automatically created for the role.
Step 2: We are installing Redis from source, here is the script for both Debian and redhat flavor. Now create scripts for both the files
Step 3: Add the handler to restart the service
Step 4: Create task main.yml
Step 5: create a centos.yml file in tasks
Step 6: redisserver/tasks/ubuntu.yml
That’s it, now we have completed role creation for Redis server.
Now create a file for playbook for a host using role.
Now run your play book by executing the below command,