From 0da675db1cbaea2cef5b3be754d859dd54fae4e9 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 9 Feb 2020 13:19:45 +0000 Subject: [PATCH] Add quassel config --- .../docker/files/quassel/docker-compose.yml | 34 +++++++++++++++++++ ansible/roles/docker/tasks/main.yml | 3 ++ ansible/roles/docker/tasks/quassel.yml | 31 +++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 ansible/roles/docker/files/quassel/docker-compose.yml create mode 100644 ansible/roles/docker/tasks/quassel.yml diff --git a/ansible/roles/docker/files/quassel/docker-compose.yml b/ansible/roles/docker/files/quassel/docker-compose.yml new file mode 100644 index 0000000..6e78bfb --- /dev/null +++ b/ansible/roles/docker/files/quassel/docker-compose.yml @@ -0,0 +1,34 @@ +version: "3" +services: + quassel-core: + image: linuxserver/quassel-core:0.13.1-ls39 + container_name: quassel + environment: + - PUID={{ docker_user.id }} + - PGID={{ docker_user.id }} + - TZ=Europe/London + - DB_BACKEND=PostgreSQL + - DB_PGSQL_USERNAME=quassel + - DB_PGSQL_PASSWORD=quassel + - DB_PGSQL_HOSTNAME=db + - DB_PGSQL_PORT=5432 + - AUTH_AUTHENTICATOR=Database + - RUN_OPTS=--config-from-environment + restart: unless-stopped + depends_on: + - db + ports: + - "{{ wireguard.clients.intersect.ip }}:4242:4242" + + db: + image: postgres:12-alpine + restart: unless-stopped + environment: + - POSTGRES_USER=quassel + - POSTGRES_PASSWORD=quassel + volumes: + - ./postgresql:/var/lib/postgresql/data + + tor-socks-proxy: + image: peterdavehello/tor-socks-proxy:latest + restart: unless-stopped diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml index 19cb2cb..fe6696f 100644 --- a/ansible/roles/docker/tasks/main.yml +++ b/ansible/roles/docker/tasks/main.yml @@ -45,3 +45,6 @@ - name: Install torrent include: torrent.yml + +- name: Install quassel + include: quassel.yml diff --git a/ansible/roles/docker/tasks/quassel.yml b/ansible/roles/docker/tasks/quassel.yml new file mode 100644 index 0000000..a35b53d --- /dev/null +++ b/ansible/roles/docker/tasks/quassel.yml @@ -0,0 +1,31 @@ +- name: Create quassel directory + file: + path: '/opt/quassel' + state: directory + owner: "{{ docker_user.name }}" + mode: "{{ docker_compose_directory_mask }}" + become: true + become_user: root + +- name: Install quassel compose file + template: + src: files/quassel/docker-compose.yml + dest: "/opt/quassel/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: Cycle quassel container + docker_compose: + project_src: /opt/quassel + pull: true + remove_orphans: true + remove_volumes: true + state: "{{ item }}" + when: compose_file.changed + loop: + - absent + - present