Migrate to bigger Hetzner server

This commit is contained in:
Paul-Henri Froidmont 2019-11-05 03:37:05 +01:00
parent d77f2ef548
commit 86fb8e71c1
32 changed files with 294 additions and 226 deletions

View file

@ -1,12 +1,16 @@
---
- name: Copy traefik config
copy: src=traefik dest={{docker_compose_files_folder}}
- name: Create traefik .env
- name: Copy traefik files
template:
src: traefik/.env
dest: "{{docker_compose_files_folder}}/traefik/.env"
src: "{{item}}"
dest: "{{docker_compose_files_folder}}/traefik/{{item}}"
loop:
- .env
- docker-compose.yml
- data/traefik.toml
- name: Create web docker network
docker_network:
name: web
- name: Start traefik docker project
docker_compose: project_src={{docker_compose_files_folder}}/traefik state=present
docker_compose:
project_src: "{{docker_compose_files_folder}}/traefik"
state: present

View file

@ -1 +1 @@
TRAEFIK_DASHBOARD_PASSWORD_HASH={{traefik_dashboard_password_hash}}
TRAEFIK_DASHBOARD_PASSWORD_HASH={{traefik_dashboard_password_hash}}

View file

@ -23,7 +23,11 @@ dashboard = true
[docker]
endpoint = "unix:///var/run/docker.sock"
{% if inventory_hostname in (groups['mail']) %}
domain = "mail1.banditlair.com"
{% else %}
domain = "banditlair.com"
{% endif %}
watch = true
exposedbydefault = false
@ -37,8 +41,13 @@ KeyType = "RSA4096"
entryPoint = "http"
[[acme.domains]]
{% if inventory_hostname in (groups['mail']) %}
main = "mail1.banditlair.com"
{% else %}
main = "banditlair.com"
sans = ["mail.banditlair.com"]
{% endif %}
[accessLog]
filePath = "/var/log/traefik/access.log"

View file

@ -15,7 +15,7 @@ services:
labels:
- "traefik.backend=traefik"
- "traefik.docker.network=web"
- "traefik.frontend.rule=Host:traefik.banditlair.com"
- "traefik.frontend.rule=Host:traefik.{{inventory_hostname}}.banditlair.com"
- "traefik.enable=true"
- "traefik.port=8080"
- "traefik.default.protocol=http"