Commit 8ebe3a30 by Feanil Patel

A redis server role.

parent a1aae5cf
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Defaults for role redis
#
REDIS_PASSWORD: !!null
REDIS_BIND_IP: 127.0.0.1
REDIS_PERSISTENCE_DIR: "/var/lib/redis"
REDIS_MEMORY_LIMIT: "512mb"
REDIS_MAX_MEMORY_POLICY: "noeviction"
#
# vars are namespace with the module name.
#
redis_role_name: redis
redis_ppa: "ppa:rwky/redis"
redis_user: redis
redis_group: redis
#
# OS packages
#
redis_debian_pkgs:
- "redis-server=2:2.8.10-rwky1~precise"
redis_redhat_pkgs: []
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Handlers for role redis
#
# Overview:
#
#
- name: reload redis
service: name=redis-server state=restarted
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Role includes for role redis
#
# Example:
#
# dependencies:
# - {
# role: my_role
# my_role_var0: "foo"
# my_role_var1: "bar"
# }
dependencies:
- common
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Tasks for role redis
#
# Overview:
#
#
# Dependencies:
#
#
# Example play:
#
#
- name: add the redis ppa
apt_repository: repo="{{ redis_ppa }}"
- name: install redis system packages
apt: pkg={{ item }} install_recommends=yes state=present
with_items: redis_debian_pkgs
notify: reload redis
- name: ensure the redis group exists
group: name={{ redis_group }} state=present
- name: ensure the redis user exists
user: name={{ redis_user }} append=yes group={{ redis_group }}
- name: update redis configuration
template: >
src=etc/redis/redis.conf.j2
dest=/etc/redis/redis.conf
owner=root
group={{ redis_group }}
mode=640
notify: reload redis
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment