homelab/roles/peertube/tasks/main.yml

60 lines
1.4 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'
2024-10-29 02:12:07 +05:00
owner: "999"
group: "999"
2024-10-21 23:02:30 +05:00
- name: Copy default config
become: true
ansible.builtin.copy:
src: default.yaml
dest: /etc/peertube/default.yaml
2024-10-29 02:12:07 +05:00
owner: "999"
group: "999"
2024-10-21 23:02:30 +05:00
- name: Copy production config
become: true
ansible.builtin.template:
src: production.yaml.j2
dest: /etc/peertube/production.yaml
2024-10-29 02:12:07 +05:00
owner: "999"
group: "999"
2024-10-21 23:02:30 +05:00
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 }}"
2024-10-30 17:46:28 +05:00
restart_policy: unless-stopped