homelab/roles/peertube/tasks/redis.yml

35 lines
882 B
YAML
Raw Normal View History

2024-10-19 00:09:55 +05:00
---
- name: Create peertube network
become: true
community.docker.docker_network:
name: peertube
- name: Create peertube-redis docker volume
become: true
community.docker.docker_volume:
name: peertube-redis
- name: Create /etc/redis/peertube dir
become: true
ansible.builtin.file:
path: /etc/redis/peertube
state: directory
mode: '1755'
owner: root
group: root
- name: Copy redis config
become: true
ansible.builtin.copy:
src: redis.conf
dest: /etc/redis/peertube/redis.conf
- name: Run peertube-redis container
become: true
community.docker.docker_container:
name: peertube-redis
image: redis:7.4-bookworm
command: ["redis-server", "/etc/redis/redis.conf"]
networks:
- name: peertube
volumes:
- peertube-redis:/data
- /etc/redis/peertube:/etc/redis:ro
restart_policy: unless-stopped