From 540d528ab64b82731217431d68490c315b153718 Mon Sep 17 00:00:00 2001 From: josiah Date: Tue, 20 Dec 2022 20:18:10 -0600 Subject: [PATCH] Configure halo templates. --- ansible/roles/halo/tasks/main.yml | 21 ++++++++++++++++--- ansible/roles/halo/templates/halo-compose.yml | 12 +++++++---- ansible/roles/halo/templates/traefik.yml | 6 ++++++ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/ansible/roles/halo/tasks/main.yml b/ansible/roles/halo/tasks/main.yml index 00b8048..17a6d73 100644 --- a/ansible/roles/halo/tasks/main.yml +++ b/ansible/roles/halo/tasks/main.yml @@ -53,7 +53,7 @@ - name: ensure the app folders exist file: state=directory path={{ item }} owner=josiah group=josiah mode=0700 - loop: [ '/home/josiah/apps/smokeping/', '/home/josiah/apps/smokeping/config/', '/home/josiah/apps/letsencrypt/', '/home/josiah/apps/smokeping/config/', '/home/josiah/apps/smokeping/data' ] + loop: [ '/home/josiah/apps/smokeping/', '/home/josiah/apps/letsencrypt/', '/home/josiah/apps/smokeping/config/', '/home/josiah/apps/smokeping/data', '/home/josiah/apps/overseerr/config/' ] - name: copy over awful-All config files template: @@ -62,8 +62,23 @@ mode: 0777 with_items: - {src: 'halo-compose.yml', dest: '/home/josiah/apps/halo-compose.yml'} - - {src: 'traefik.yml', dest: '/home/josiah/apps/traefik.yml'} - - {src: 'Targets', dest: '/home/josiah/apps/smokeping/config/Targets'} + - {src: 'traefik.yml', dest: '/home/josiah/apps/traefik/traefik.yml'} + - {src: 'Targets', dest: '/home/josiah/apps/smokeping/config/Targets'} + + +# you have to force remove the whole stack for some changes to take effect +# I have no idea which ones, but this solved a problem for me with traefik conifgs + multi networks. +- name: Remove the mediaserver stack + block: + - name: Remove the mediaserver stack + docker_stack: + state: absent + name: mediaserver + compose: + - /home/josiah/apps/halo/halo-compose.yml + - name: Pause so the network gets deleted too + pause: + seconds: 15 - name: Deploy halo stack docker_stack: diff --git a/ansible/roles/halo/templates/halo-compose.yml b/ansible/roles/halo/templates/halo-compose.yml index ef4224c..d14f770 100644 --- a/ansible/roles/halo/templates/halo-compose.yml +++ b/ansible/roles/halo/templates/halo-compose.yml @@ -1,8 +1,6 @@ version: '3' networks: - gitea: - external: false pubnet: external: false @@ -11,7 +9,7 @@ volumes: traefik_logs: services: - traefik: + justice: image: "traefik:v2.2" ports: - "80:80" @@ -23,7 +21,7 @@ services: volumes: - "/home/josiah/apps/letsencrypt/:/letsencrypt" - "/var/run/docker.sock:/var/run/docker.sock:ro" - - "/home/josiah/apps/traefik.yml:/etc/traefik/traefik.yml" + - "/home/josiah/apps/traefik/traefik.yml:/etc/traefik/traefik.yml" - traefik_logs:/log labels: - "traefik.enable=true" @@ -31,6 +29,12 @@ services: - "traefik.http.routers.edge.entrypoints=web" - "traefik.http.routers.edge.middlewares=redirect-to-https" - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" + deploy: + mode: global + placement: + constraints: + - node.role == manager + smokeping: image: lscr.io/linuxserver/smokeping:latest diff --git a/ansible/roles/halo/templates/traefik.yml b/ansible/roles/halo/templates/traefik.yml index 49c75aa..fbe227b 100644 --- a/ansible/roles/halo/templates/traefik.yml +++ b/ansible/roles/halo/templates/traefik.yml @@ -15,6 +15,12 @@ entryPoints: websecure: address: ":443" +log: + level: debug + format: common +accessLog: + format: common + providers: docker: watch: true