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
_ansible/roles/tinytinyrss

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: