forked from ISTI-ansible-roles/ansible-roles
library/roles/redis: Cleanup the redis role.
This commit is contained in:
parent
dda9366e83
commit
eb5aa6f7c5
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
redis_install: False
|
||||||
redis_enabled: True
|
redis_enabled: True
|
||||||
# https://launchpad.net/~chris-lea/+archive/ubuntu/redis-server
|
# https://launchpad.net/~chris-lea/+archive/ubuntu/redis-server
|
||||||
redis_ppa_repo: ppa:chris-lea/redis-server
|
redis_ppa_repo: ppa:chris-lea/redis-server
|
||||||
|
|
|
@ -1,19 +1,34 @@
|
||||||
---
|
---
|
||||||
- name: Install the Redis PPA
|
- block:
|
||||||
apt_repository: repo='{{ redis_ppa_repo }}' update_cache=yes
|
- name: Install the Redis PPA
|
||||||
tags: redis
|
apt_repository: repo='{{ redis_ppa_repo }}' update_cache=yes
|
||||||
|
|
||||||
- name: Install the Redis package
|
- name: Install the Redis packages
|
||||||
apt: pkg={{ item }} state=present
|
apt: pkg={{ item }} state={[ redis_pkg_state }} cache_valid_time=1800
|
||||||
with_items: '{{ redis_server_pkg }}'
|
with_items: '{{ redis_server_pkg }}'
|
||||||
tags: redis
|
|
||||||
|
|
||||||
- name: Start and enable the Redis service
|
- name: Start and enable the Redis service
|
||||||
service: name=redis-server state=started enabled=yes
|
service: name=redis-server state=started enabled=yes
|
||||||
when: redis_enabled
|
when: redis_enabled
|
||||||
tags: redis
|
|
||||||
|
|
||||||
- name: Stop and disable the Redis service
|
- name: Stop and disable the Redis service
|
||||||
service: name=redis-server state=stopped enabled=no
|
service: name=redis-server state=stopped enabled=no
|
||||||
when: not redis_enabled
|
when: not redis_enabled
|
||||||
tags: redis
|
|
||||||
|
when: redis_install
|
||||||
|
tags: redis
|
||||||
|
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- name: Stop and disable the Redis service
|
||||||
|
service: name=redis-server state=stopped enabled=no
|
||||||
|
|
||||||
|
- name: Remove the Redis packages
|
||||||
|
apt: pkg={{ item }} state=absent
|
||||||
|
with_items: '{{ redis_server_pkg }}'
|
||||||
|
|
||||||
|
- name: Remove the Redis PPA
|
||||||
|
apt_repository: repo='{{ redis_ppa_repo }}' state=absent update_cache=yes
|
||||||
|
|
||||||
|
when: not redis_install
|
||||||
|
tags: redis
|
||||||
|
|
Loading…
Reference in New Issue