Add tinytinyrss to ansible

This commit is contained in:
Tobias Reisinger 2023-12-11 01:42:57 +01:00
parent 0c6ef34cf6
commit 2b8aef7f9f
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
14 changed files with 95 additions and 78 deletions

View file

@ -15,6 +15,11 @@ compose_file_main:
apps:
external: true
compose_file_depends_on:
services:
app:
depends_on: "{{ compose.depends_on }}"
compose_file_env:
services:
app:

View file

@ -18,6 +18,7 @@
- jellyfin
- tandoor
- telegraf
- tinytinyrss
- umami
- uptime-kuma
- watchtower

View file

@ -13,6 +13,7 @@
- jellyfin
- tandoor
- telegraf
- tinytinyrss
- umami
- uptime-kuma
- watchtower

View file

@ -0,0 +1,61 @@
worker_processes auto;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
error_log /dev/stderr warn;
sendfile on;
index index.php;
upstream app {
server tt-rss:9000;
}
server {
listen 80;
listen [::]:80;
root /var/www/html;
location /tt-rss/cache {
aio threads;
internal;
}
location /tt-rss/backups {
internal;
}
location ~ \.php$ {
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_pass app;
}
location / {
try_files $uri $uri/ =404;
}
}
}

View file

@ -0,0 +1,16 @@
---
- name: Deploy {{ svc.name }}
tags:
- tinytinyrss
- tt-rss
- news
block:
- import_tasks: prepare-common-service.yml
- name: Copy the nginx-config
ansible.builtin.copy:
src: nginx.conf
dest: "{{ (service_path, 'nginx.conf') | path_join }}"
mode: '0644'
- import_tasks: start-common-service.yml

View file

@ -0,0 +1,56 @@
svc:
domain: "rss.serguzim.me"
name: tinytinyrss
port: 80
db:
host: "{{ postgres.host }}"
port: "{{ postgres.port }}"
database: tinytinyrss
user: "{{ vault_tinytinyrss.db.user }}"
pass: "{{ vault_tinytinyrss.db.pass }}"
svc_env:
TTRSS_DB_TYPE: pgsql
TTRSS_DB_HOST: "{{ svc.db.host }}"
TTRSS_DB_NAME: "{{ svc.db.database }}"
TTRSS_DB_USER: "{{ svc.db.user }}"
TTRSS_DB_PASS: "{{ svc.db.pass }}"
TTRSS_SELF_URL_PATH: https://{{ svc.domain }}/tt-rss/
compose:
watchtower: false
image: cthulhoo/ttrss-web-nginx
depends_on:
- tt-rss
env: true
volumes:
- app:/var/www/html:ro
- ./nginx.conf:/etc/nginx/nginx.conf
file:
services:
tt-rss:
image: cthulhoo/ttrss-fpm-pgsql-static
restart: always
env_file:
- service.env
volumes:
- app:/var/www/html
networks:
local-net:
updater:
image: cthulhoo/ttrss-fpm-pgsql-static
restart: always
env_file:
- service.env
volumes:
- app:/var/www/html
depends_on:
- tt-rss
command: /opt/tt-rss/updater.sh
networks:
local-net:
volumes:
app:

View file

@ -1,7 +1,2 @@
- import_tasks: steps/create-service-directory.yml
- import_tasks: steps/template-docker-compose.yml
- import_tasks: steps/template-service-env.yml
when: compose.env|default(False) == True
- include_tasks: steps/template-site-config.yml
when: svc.domain is defined
- import_tasks: steps/start-service.yml
- import_tasks: prepare-common-service.yml
- import_tasks: start-common-service.yml

View file

@ -0,0 +1,4 @@
- import_tasks: steps/create-service-directory.yml
- import_tasks: steps/template-docker-compose.yml
- import_tasks: steps/template-service-env.yml
when: compose.env|default(False) == True

View file

@ -0,0 +1,3 @@
- include_tasks: steps/template-site-config.yml
when: svc.domain is defined
- import_tasks: steps/start-service.yml

View file

@ -1,6 +1,10 @@
{%- set compose_file = compose.file | default({}) -%}
{%- set compose_file = compose_file_main | combine(compose_file, recursive=True) -%}
{%- if compose.depends_on | default(False) -%}
{%- set compose_file = compose_file | combine(compose_file_depends_on, recursive=True) -%}
{%- endif -%}
{%- if compose.env | default(False) -%}
{%- set compose_file = compose_file | combine(compose_file_env, recursive=True) -%}
{%- endif -%}