2023-05-13 06:44:40 +05:30
|
|
|
---
|
|
|
|
- name: Setup Caddy
|
2023-07-17 22:36:06 +05:30
|
|
|
hosts: privfrontends,core
|
2023-05-13 06:44:40 +05:30
|
|
|
tasks:
|
2023-06-05 14:32:24 +05:30
|
|
|
- name: Copy Caddyfile
|
2023-07-07 22:40:54 +05:30
|
|
|
ansible.builtin.template:
|
2023-06-05 14:32:24 +05:30
|
|
|
src: ./templates/Caddyfile.j2
|
|
|
|
dest: /etc/caddy/Caddyfile
|
2023-07-07 22:40:54 +05:30
|
|
|
mode: preserve
|
2023-06-05 14:32:24 +05:30
|
|
|
tags: caddy-non-update
|
2023-05-13 06:44:40 +05:30
|
|
|
- name: Copy per-server caddy extras
|
2023-07-07 22:40:54 +05:30
|
|
|
ansible.builtin.copy:
|
2023-05-29 14:08:34 +05:30
|
|
|
src: "./templates/{{ inventory_hostname }}/"
|
|
|
|
dest: /etc/caddy/
|
|
|
|
directory_mode: true
|
2023-07-07 22:40:54 +05:30
|
|
|
mode: preserve
|
2023-06-05 14:32:24 +05:30
|
|
|
tags: caddy-non-update
|
|
|
|
- name: Reload Caddy
|
2023-07-07 22:40:54 +05:30
|
|
|
ansible.builtin.service:
|
2023-05-29 21:19:16 +05:30
|
|
|
name: caddy
|
2023-07-07 22:40:54 +05:30
|
|
|
enabled: true
|
2023-06-05 14:32:24 +05:30
|
|
|
state: reloaded
|
|
|
|
tags: caddy-non-update
|
2023-05-13 06:44:40 +05:30
|
|
|
- name: Setup docker compose for privacy frontends
|
2023-05-14 15:56:43 +05:30
|
|
|
hosts: privfrontends
|
2023-05-13 06:44:40 +05:30
|
|
|
vars:
|
|
|
|
docker_services:
|
|
|
|
- librarian
|
|
|
|
- libreddit
|
|
|
|
- nitter
|
2023-06-10 23:28:18 +05:30
|
|
|
- teddit
|
2023-05-13 06:44:40 +05:30
|
|
|
- watchtower
|
|
|
|
tasks:
|
|
|
|
# community.docker does not support compose 2.0 right now.
|
|
|
|
# https://github.com/ansible-collections/community.docker/issues/216
|
|
|
|
- name: Update docker compose files and restart those with changes
|
2023-07-07 22:40:54 +05:30
|
|
|
ansible.builtin.include_tasks: docker-tasks.yaml
|
2023-05-13 06:44:40 +05:30
|
|
|
with_items: "{{ docker_services }}"
|
2023-06-05 14:32:24 +05:30
|
|
|
tags: docker
|
2023-07-17 22:36:06 +05:30
|
|
|
- name: Setup docker compose for privacy frontends (soleil+normal)
|
|
|
|
hosts: in,us,docker
|
2023-07-07 22:40:54 +05:30
|
|
|
vars:
|
|
|
|
non_pizza_docker_services:
|
2023-07-17 22:36:06 +05:30
|
|
|
- anonymousoverflow
|
|
|
|
- breezewiki
|
|
|
|
- gothub
|
|
|
|
- gothub-dev
|
2023-07-07 22:40:54 +05:30
|
|
|
- searxng
|
2023-07-17 22:36:06 +05:30
|
|
|
- hyperpipe
|
|
|
|
- rimgo
|
|
|
|
- safetwitch
|
|
|
|
- scribe
|
|
|
|
- simplytranslate
|
2023-07-07 22:40:54 +05:30
|
|
|
tasks:
|
|
|
|
# community.docker does not support compose 2.0 right now.
|
|
|
|
# https://github.com/ansible-collections/community.docker/issues/216
|
2023-05-13 06:44:40 +05:30
|
|
|
- name: Update docker compose files and restart those with changes (Privacy Frontends but without Pizza1)
|
2023-07-07 22:40:54 +05:30
|
|
|
ansible.builtin.include_tasks: docker-tasks.yaml
|
2023-05-13 06:44:40 +05:30
|
|
|
with_items: "{{ non_pizza_docker_services }}"
|
2023-06-05 14:32:24 +05:30
|
|
|
tags: docker
|
2023-05-16 15:25:01 +05:30
|
|
|
|
|
|
|
- name: Setup cron jobs
|
|
|
|
hosts: privfrontends
|
|
|
|
tasks:
|
|
|
|
- name: Restart invidious every hour
|
2023-07-07 22:40:54 +05:30
|
|
|
ansible.builtin.cron:
|
2023-05-16 15:25:01 +05:30
|
|
|
name: "hourly invidious restart"
|
|
|
|
special_time: hourly
|
2023-07-07 22:40:54 +05:30
|
|
|
job: "docker restart invidious-invidious-1 && curl https://healthchecks.projectsegfau.lt/ping/{{ invidious_hc_uuid }}"
|
2023-06-05 14:32:24 +05:30
|
|
|
tags: cron
|
2023-05-16 15:25:01 +05:30
|
|
|
- name: Restart teddit every hour
|
2023-07-07 22:40:54 +05:30
|
|
|
ansible.builtin.cron:
|
2023-05-16 15:25:01 +05:30
|
|
|
name: "hourly teddit restart"
|
|
|
|
special_time: hourly
|
2023-07-07 22:40:54 +05:30
|
|
|
job: "docker restart teddit && curl https://healthchecks.projectsegfau.lt/ping/{{ teddit_hc_uuid }}"
|
2023-06-05 14:32:24 +05:30
|
|
|
tags: cron
|