diff --git a/README.md b/README.md index 4cba545..eea1a8f 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,11 @@ Snapshotting configuration; setting values in this list will save the database t Database compression and location configuration. redis_maxmemory: 0 - + Limit memory usage to the specified amount of bytes. Leave at 0 for unlimited. redis_maxmemory_policy: "noeviction" - + The method to use to keep memory usage below the limit, if specified. See [Using Redis as an LRU cache](http://redis.io/topics/lru-cache). redis_maxmemory_samples: 5 @@ -73,6 +73,10 @@ Valid values are `always` (slower, safest), `everysec` (happy medium), or `no` ( Add extra include file paths to this list to include more/localized Redis configuration. +The redis package name for installation via the system package manager. Defaults to `redis-server` on Debian and `redis` on RHEL. + + redis_package_name: "redis28u" + ## Dependencies None. diff --git a/tasks/main.yml b/tasks/main.yml index ec8de51..b6799b2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,6 +3,16 @@ - name: Include OS-specific variables. include_vars: "{{ ansible_os_family }}.yml" +- name: Define redis package name + set_fact: + redis_package_name: "{{ _redis_package_name }}" + when: redis_package_name is not defined + +- name: Define redis repository name if the OS is RedHat + set_fact: + redis_package_enablerepo: "{{ _redis_package_enablerepo }}" + when: redis_package_enablerepo is not defined and ansible_os_family == 'RedHat' + # Setup/install tasks. - include: setup-RedHat.yml when: ansible_os_family == 'RedHat' diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index c105caf..c5f370f 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -1,3 +1,3 @@ --- - name: Ensure redis is installed. - apt: name=redis-server state=installed + apt: name={{ redis_package_name }} state=installed diff --git a/tasks/setup-RedHat.yml b/tasks/setup-RedHat.yml index 85ed909..57abc4b 100644 --- a/tasks/setup-RedHat.yml +++ b/tasks/setup-RedHat.yml @@ -1,3 +1,3 @@ --- - name: Ensure redis is installed. - yum: name=redis state=installed enablerepo=epel + yum: name={{ redis_package_name }} state=installed enablerepo={{ redis_package_enablerepo }} diff --git a/vars/Debian.yml b/vars/Debian.yml index 517d91a..9f2b913 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -1,3 +1,4 @@ --- redis_daemon: redis-server redis_conf_path: /etc/redis/redis.conf +_redis_package_name: redis-server diff --git a/vars/RedHat.yml b/vars/RedHat.yml index d4f603c..390c188 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -1,3 +1,5 @@ --- redis_daemon: redis redis_conf_path: /etc/redis.conf +_redis_package_name: redis +_redis_package_enablerepo: epel