2022-12-27 16:07:19 +01:00
|
|
|
---
|
2022-12-27 16:36:24 +01:00
|
|
|
- name: Add Invidious vhosts to list
|
|
|
|
set_fact:
|
|
|
|
vhosts: "{{ vhosts + invidious_vhosts }}"
|
|
|
|
|
|
|
|
- name: Ensure Apache virtual host is configured
|
|
|
|
ansible.builtin.import_role:
|
|
|
|
name: apache_ssl_vhosts
|
|
|
|
when: handle_apache2_reverse_proxy
|
2022-12-27 16:07:19 +01:00
|
|
|
|
2023-02-07 17:11:23 +01:00
|
|
|
- name: Ensure Invidious configuration folder exists in host
|
|
|
|
file:
|
|
|
|
path: /etc/invidious_container
|
|
|
|
state: directory
|
|
|
|
|
2023-02-07 16:47:08 +01:00
|
|
|
- name: Ensure Invidious configuration file exists in host
|
|
|
|
copy:
|
2023-02-07 17:11:23 +01:00
|
|
|
dest: /etc/invidious_container/config.yml
|
2023-02-07 16:47:08 +01:00
|
|
|
content: "{{ invidious_config | to_yaml() }}"
|
|
|
|
backup: true
|
|
|
|
|
2023-02-07 17:11:23 +01:00
|
|
|
- name: Ensure Invidious configuration from repo is copied
|
|
|
|
copy:
|
2023-02-07 17:16:40 +01:00
|
|
|
src: "{{ invidious_folder }}/config/"
|
2023-02-07 17:11:23 +01:00
|
|
|
dest: /etc/invidious_container/
|
|
|
|
remote_src: true
|
2023-02-07 17:16:40 +01:00
|
|
|
|
2023-02-07 17:11:23 +01:00
|
|
|
|
2022-12-27 16:53:36 +01:00
|
|
|
- name: Ensure Invidious composition is created
|
2022-12-27 16:07:19 +01:00
|
|
|
template:
|
|
|
|
src: templates/docker-compose.yml.j2
|
|
|
|
dest: "{{ invidious_folder }}/docker-compose.yml"
|
2023-02-07 16:47:08 +01:00
|
|
|
backup: true
|
2022-12-27 16:14:36 +01:00
|
|
|
|
2022-12-27 16:45:26 +01:00
|
|
|
- name: Ensure composition is up
|
|
|
|
community.docker.docker_compose:
|
2022-12-28 08:57:07 +01:00
|
|
|
project_name: "{{ invidious_project_name }}"
|
2022-12-27 16:45:26 +01:00
|
|
|
project_src: "{{ invidious_folder }}"
|
|
|
|
|
2022-12-27 16:23:45 +01:00
|
|
|
- name: Ensure UFW allows port access
|
|
|
|
ufw:
|
|
|
|
rule: allow
|
|
|
|
port: "{{ invidious_internal_port }}"
|
|
|
|
when: handle_ufw
|
2022-12-28 08:57:07 +01:00
|
|
|
|
|
|
|
- name: Ensure Invidious is restarted every hour
|
|
|
|
cron:
|
|
|
|
name: restart_invidious
|
2023-05-01 14:55:05 +02:00
|
|
|
job: "docker container restart {{ invidious_project_name }}_invidious_1 > /dev/null"
|
2022-12-28 08:57:07 +01:00
|
|
|
minute: 56
|