homelab/roles/peertube/tasks/main.yml

55 lines
1.3 KiB
YAML
Raw Normal View History

2024-10-19 00:09:55 +05:00
---
2024-10-21 23:02:30 +05:00
- name: Create peertube network
become: true
community.docker.docker_network:
name: peertube
- name: Create redis container
include_role:
name: redis
vars:
preset: persistent
container_name: peertube-redis
docker_networks:
- name: peertube
docker_volume: peertube-redis
- name: Create peertube config dir
become: true
ansible.builtin.file:
path: /etc/peertube
state: directory
mode: '1700'
owner: root
group: root
- name: Copy default config
become: true
ansible.builtin.copy:
src: default.yaml
dest: /etc/peertube/default.yaml
- name: Copy production config
become: true
ansible.builtin.template:
src: production.yaml.j2
dest: /etc/peertube/production.yaml
register: cfg
- name: Create peertube-data volume
become: true
community.docker.docker_volume:
name: peertube-data
- name: Run peertube container
become: true
community.docker.docker_container:
name: peertube
image: chocobozzz/peertube:v6.3.2-bookworm
networks:
- name: peertube
- name: haproxy
- name: postgresql
volumes:
- /mnt/hdd/peertube:/data
- /etc/peertube:/config
mounts:
- type: tmpfs
target: /data/tmp
tmpfs_size: "4G"
recreate: "{{ cfg.changed }}"