From ac12da5c0251e157006598c6affab3e35841fc65 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 9 Feb 2020 12:43:38 +0000 Subject: [PATCH] Add tt-rss --- ansible/roles/docker/files/tt-rss/config.php | 180 ++++++++++++++++++ .../docker/files/tt-rss/docker-compose.yml | 27 +++ ansible/roles/docker/tasks/main.yml | 3 + ansible/roles/docker/tasks/tt-rss.yml | 49 +++++ 4 files changed, 259 insertions(+) create mode 100644 ansible/roles/docker/files/tt-rss/config.php create mode 100644 ansible/roles/docker/files/tt-rss/docker-compose.yml create mode 100644 ansible/roles/docker/tasks/tt-rss.yml diff --git a/ansible/roles/docker/files/tt-rss/config.php b/ansible/roles/docker/files/tt-rss/config.php new file mode 100644 index 0000000..013aa4d --- /dev/null +++ b/ansible/roles/docker/files/tt-rss/config.php @@ -0,0 +1,180 @@ + System), syslog - logs to system log. + // Setting this to blank uses PHP logging (usually to http server + // error.log). + // Note that feed updating daemons don't use this logging facility + // for normal output. + + define('CONFIG_VERSION', 26); + // Expected config version. Please update this option in config.php + // if necessary (after migrating all new options from this file). diff --git a/ansible/roles/docker/files/tt-rss/docker-compose.yml b/ansible/roles/docker/files/tt-rss/docker-compose.yml new file mode 100644 index 0000000..6e835f7 --- /dev/null +++ b/ansible/roles/docker/files/tt-rss/docker-compose.yml @@ -0,0 +1,27 @@ +version: "3" + +services: + tt-rss: + image: lunik1/tt-rss:latest + container_name: tt-rss + environment: + - PUID={{ docker_user.id }} + - PGID={{ docker_user.id }} + - TZ=Europe/London + volumes: + - ./config:/config + restart: unless-stopped + labels: + - "traefik.enable=true" + - "traefik.http.routers.tt-rss.rule=Host(`tt-rss.jakehoward.tech`)" + - "traefik.http.routers.tt-rss.tls=true" + - "traefik.http.routers.tt-rss.tls.certresolver=le" + + db: + image: postgres:12-alpine + restart: unless-stopped + volumes: + - ./postgres:/var/lib/postgresql/data + environment: + - POSTGRES_PASSWORD=tt-rss + - POSTGRES_USER=tt-rss diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml index e0249c0..08779b7 100644 --- a/ansible/roles/docker/tasks/main.yml +++ b/ansible/roles/docker/tasks/main.yml @@ -39,3 +39,6 @@ - name: Install yourls include: yourls.yml + +- name: Install tt-rss + include: tt-rss.yml diff --git a/ansible/roles/docker/tasks/tt-rss.yml b/ansible/roles/docker/tasks/tt-rss.yml new file mode 100644 index 0000000..83c4f99 --- /dev/null +++ b/ansible/roles/docker/tasks/tt-rss.yml @@ -0,0 +1,49 @@ +- name: Create tt-rss directory + file: + path: '/opt/tt-rss' + state: directory + owner: "{{ docker_user.name }}" + mode: "{{ docker_compose_directory_mask }}" + become: true + become_user: root + +- name: Install tt-rss compose file + template: + src: files/tt-rss/docker-compose.yml + dest: "/opt/tt-rss/docker-compose.yml" + mode: "{{ docker_compose_file_mask }}" + owner: "{{ docker_user.name }}" + validate: /usr/bin/docker-compose -f %s config + register: compose_file + become: true + become_user: root + +- name: Create tt-rss config directory + file: + path: '/opt/tt-rss/config' + state: directory + mode: "{{ docker_compose_directory_mask }}" + become: true + become_user: root + +- name: Install tt-rss config + template: + src: files/tt-rss/config.php + dest: "/opt/tt-rss/config/config.php" + mode: "{{ docker_compose_file_mask }}" + owner: "{{ docker_user.name }}" + register: config_file + become: true + become_user: root + +- name: Cycle tt-rss container + docker_compose: + project_src: /opt/tt-rss + pull: true + remove_orphans: true + remove_volumes: true + state: "{{ item }}" + when: compose_file.changed or config_file.changed + loop: + - absent + - present