diff --git a/ansible/host_vars/pve-docker.yml b/ansible/host_vars/pve-docker.yml index 5730a8b..625cc2e 100644 --- a/ansible/host_vars/pve-docker.yml +++ b/ansible/host_vars/pve-docker.yml @@ -2,3 +2,6 @@ expose_ssh: true traefik_private_ip: "{{ ansible_default_ipv4.address }}" traefik_proxy_protocol_trusted_ips: 10.23.0.0/16 + +traefik_provider_jellyfin: true +traefik_provider_homeassistant: true diff --git a/ansible/roles/traefik/defaults/main.yml b/ansible/roles/traefik/defaults/main.yml index 93e1372..ace9b9c 100644 --- a/ansible/roles/traefik/defaults/main.yml +++ b/ansible/roles/traefik/defaults/main.yml @@ -2,3 +2,6 @@ traefik_private_ip: "{{ wireguard.clients[ansible_fqdn].ip }}" traefik_influx_db_dir: ./influxdb traefik_proxy_protocol_trusted_ips: "{{ wireguard.cidr }}" + +traefik_provider_jellyfin: false +traefik_provider_homeassistant: false diff --git a/ansible/roles/traefik/files/file-provider-homeassistant.yml b/ansible/roles/traefik/files/file-provider-homeassistant.yml new file mode 100644 index 0000000..df1b32d --- /dev/null +++ b/ansible/roles/traefik/files/file-provider-homeassistant.yml @@ -0,0 +1,12 @@ +http: + routers: + router-homeassistant: + rule: Host(`homeassistant.jakehoward.tech`) + service: service-homeassistant + tls: + certResolver: le + services: + service-homeassistant: + loadBalancer: + servers: + - url: http://192.168.2.41:8123 diff --git a/ansible/roles/traefik/files/file-provider-jellyfin.yml b/ansible/roles/traefik/files/file-provider-jellyfin.yml new file mode 100644 index 0000000..97cf39c --- /dev/null +++ b/ansible/roles/traefik/files/file-provider-jellyfin.yml @@ -0,0 +1,12 @@ +http: + routers: + router-jellyfin: + rule: Host(`media.jakehoward.tech`) + service: service-jellyfin + tls: + certResolver: le + services: + service-jellyfin: + loadBalancer: + servers: + - url: http://10.23.1.29:8096 diff --git a/ansible/roles/traefik/tasks/main.yml b/ansible/roles/traefik/tasks/main.yml index 682a12f..788634d 100644 --- a/ansible/roles/traefik/tasks/main.yml +++ b/ansible/roles/traefik/tasks/main.yml @@ -47,3 +47,23 @@ owner: "{{ docker_user.name }}" notify: restart traefik become: true + +- name: Install homeassistant provider + template: + src: files/file-provider-homeassistant.yml + dest: /opt/traefik/traefik/conf/homeassistant.yml + mode: "{{ docker_compose_file_mask }}" + owner: "{{ docker_user.name }}" + notify: restart traefik + when: traefik_router_homeassistant + become: true + +- name: Install jellyfin provider + template: + src: files/file-provider-jellyfin.yml + dest: /opt/traefik/traefik/conf/jellyfin.yml + mode: "{{ docker_compose_file_mask }}" + owner: "{{ docker_user.name }}" + notify: restart traefik + when: traefik_router_jellyfin + become: true