summaryrefslogtreecommitdiff
path: root/roles/redis/server/tasks/main.yml
blob: 8cd44ee5199fb78ca1fd10039cc8bf74043757c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
- name: prepare storage volume for /var/lib/redis
  when: redis_server_storage is defined
  vars:
    storage_volume: "{{ redis_server_storage | combine({'dest': '/var/lib/redis'}) }}"
  include_role:
    name: "storage/{{ redis_server_storage.type }}/volume"

- name: install redis-server packages
  apt:
    name:
    - redis-server
    state: present

- name: make sure redis can write storage directory
  file:
    path: /var/lib/redis
    state: directory
    owner: redis
    group: redis
    mode: 0750
  notify: restart redis-server

- name: configure legacy authentication password
  when: redis_server_legacy_auth_password is defined
  lineinfile:
    regexp: '^#?\s*requirepass\s'
    line: requirepass {{ redis_server_legacy_auth_password }}
    path: /etc/redis/redis.conf
  notify: restart redis-server