summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inventory/host_vars/ch-testvm-prometheus.yml7
-rw-r--r--roles/redis/server/defaults/main.yml3
-rw-r--r--roles/redis/server/tasks/main.yml16
3 files changed, 26 insertions, 0 deletions
diff --git a/inventory/host_vars/ch-testvm-prometheus.yml b/inventory/host_vars/ch-testvm-prometheus.yml
index 147e0fe3..98c128b5 100644
--- a/inventory/host_vars/ch-testvm-prometheus.yml
+++ b/inventory/host_vars/ch-testvm-prometheus.yml
@@ -41,6 +41,13 @@ sshd_allowusers_host: "{{ normal_users_host | union(admin_users_host) | union(['
## test
+redis_server_storage:
+ type: lvm
+ vg: "{{ host_name }}"
+ lv: redis
+ size: 1G
+ fs: ext4
+
redis_server_legacy_auth_password: "changeme"
diff --git a/roles/redis/server/defaults/main.yml b/roles/redis/server/defaults/main.yml
index b67716c7..58cf8ecc 100644
--- a/roles/redis/server/defaults/main.yml
+++ b/roles/redis/server/defaults/main.yml
@@ -1,2 +1,5 @@
---
+# redis_server_storage:
+# type: ...
+
# redis_server_legacy_auth_password: "very-secret"
diff --git a/roles/redis/server/tasks/main.yml b/roles/redis/server/tasks/main.yml
index 8114bced..8cd44ee5 100644
--- a/roles/redis/server/tasks/main.yml
+++ b/roles/redis/server/tasks/main.yml
@@ -1,10 +1,26 @@
---
+- 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: