From cad1cd06c2d6d3885c28b4dde3ca81d1da63841c Mon Sep 17 00:00:00 2001 From: Ivan Reshetnikov Date: Wed, 2 Oct 2024 00:21:26 +0500 Subject: [PATCH] Put redis configuration in /etc/redis --- roles/mastodon/tasks/redis.yml | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/roles/mastodon/tasks/redis.yml b/roles/mastodon/tasks/redis.yml index 1f45fdb..9ce11f1 100644 --- a/roles/mastodon/tasks/redis.yml +++ b/roles/mastodon/tasks/redis.yml @@ -1,48 +1,62 @@ --- -- name: Create docker network +- name: Create redis-mastodon docker network become: true community.docker.docker_network: name: redis-mastodon -- name: Create redis docker volume +- name: Create redis-mastodon docker volume become: true community.docker.docker_volume: name: redis-mastodon -- name: Create redis cache docker volume + +- name: Create /etc/redis/mastodon dir become: true - community.docker.docker_volume: - name: redis-mastodon-cache + ansible.builtin.file: + path: /etc/redis/mastodon + state: directory + mode: '1755' + owner: root + group: root +- name: Create /etc/redis/mastodon-cache dir + become: true + ansible.builtin.file: + path: /etc/redis/mastodon-cache + state: directory + mode: '1755' + owner: root + group: root - name: Copy redis config become: true ansible.builtin.copy: src: redis.conf - dest: /var/lib/docker/volumes/redis-mastodon/_data/redis.conf + dest: /etc/redis/mastodon/redis.conf - name: Copy redis cache config become: true ansible.builtin.copy: src: redis-cache.conf - dest: /var/lib/docker/volumes/redis-mastodon-cache/_data/redis.conf + dest: /etc/redis/mastodon-cache/redis.conf - name: Create redis container become: true community.docker.docker_container: name: redis-mastodon image: redis:7.4-bookworm - command: ["redis-server", "/data/redis.conf"] + command: ["redis-server", "/etc/redis/redis.conf"] networks: - name: redis-mastodon volumes: - redis-mastodon:/data + - /etc/redis/mastodon:/etc/redis:ro restart_policy: unless-stopped - name: Create redis cache container become: true community.docker.docker_container: name: redis-mastodon-cache image: redis:7.4-bookworm - command: ["redis-server", "/data/redis.conf"] + command: ["redis-server", "/etc/redis/redis.conf"] networks: - name: redis-mastodon volumes: - - redis-mastodon-cache:/data + - /etc/redis/mastodon-cache:/etc/redis:ro restart_policy: unless-stopped