homelab/roles/mastodon/tasks/redis.yml

63 lines
1.5 KiB
YAML
Raw Normal View History

2024-09-29 18:04:34 +05:00
---
2024-10-02 00:21:26 +05:00
- name: Create redis-mastodon docker network
2024-09-29 18:04:34 +05:00
become: true
community.docker.docker_network:
name: redis-mastodon
2024-10-02 00:21:26 +05:00
- name: Create redis-mastodon docker volume
2024-09-29 18:04:34 +05:00
become: true
community.docker.docker_volume:
name: redis-mastodon
2024-10-02 00:21:26 +05:00
- name: Create /etc/redis/mastodon dir
2024-09-29 18:04:34 +05:00
become: true
2024-10-02 00:21:26 +05:00
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
2024-09-29 18:04:34 +05:00
- name: Copy redis config
become: true
ansible.builtin.copy:
src: redis.conf
2024-10-02 00:21:26 +05:00
dest: /etc/redis/mastodon/redis.conf
2024-09-29 18:04:34 +05:00
- name: Copy redis cache config
become: true
ansible.builtin.copy:
src: redis-cache.conf
2024-10-02 00:21:26 +05:00
dest: /etc/redis/mastodon-cache/redis.conf
2024-09-29 18:04:34 +05:00
- name: Create redis container
become: true
community.docker.docker_container:
name: redis-mastodon
image: redis:7.4-bookworm
2024-10-02 00:21:26 +05:00
command: ["redis-server", "/etc/redis/redis.conf"]
2024-09-29 18:04:34 +05:00
networks:
- name: redis-mastodon
volumes:
- redis-mastodon:/data
2024-10-02 00:21:26 +05:00
- /etc/redis/mastodon:/etc/redis:ro
2024-09-29 18:04:34 +05:00
restart_policy: unless-stopped
- name: Create redis cache container
become: true
community.docker.docker_container:
name: redis-mastodon-cache
image: redis:7.4-bookworm
2024-10-02 00:21:26 +05:00
command: ["redis-server", "/etc/redis/redis.conf"]
2024-09-29 18:04:34 +05:00
networks:
- name: redis-mastodon
volumes:
2024-10-02 00:21:26 +05:00
- /etc/redis/mastodon-cache:/etc/redis:ro
2024-09-29 18:04:34 +05:00
restart_policy: unless-stopped