Add extra-services (used to be conf-hidden.d in caddy)
This commit is contained in:
parent
7400ef19ad
commit
f8c478b2e6
12 changed files with 29 additions and 107 deletions
_ansible
|
@ -18,6 +18,8 @@
|
|||
tags: [authentik, authentication]
|
||||
- role: coder
|
||||
tags: [coder, development]
|
||||
- role: extra_services
|
||||
tags: [extra-services]
|
||||
- role: faas
|
||||
tags: [faas]
|
||||
- role: forgejo
|
||||
|
|
|
@ -8,4 +8,3 @@
|
|||
|
||||
import /etc/caddy/snippets
|
||||
import /etc/caddy/conf.d/*.conf
|
||||
import /etc/caddy/conf-hidden.d/*.conf
|
||||
|
|
11
_ansible/roles/extra_services/tasks/main.yml
Normal file
11
_ansible/roles/extra_services/tasks/main.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||
|
||||
- name: Deploy extra services
|
||||
block:
|
||||
- name: Import tasks to template the site and functions for the reverse proxy
|
||||
ansible.builtin.include_tasks: tasks/steps/template-site-config.yml
|
||||
loop: "{{ extra_services_all }}"
|
||||
loop_control:
|
||||
loop_var: svc
|
14
_ansible/roles/extra_services/vars/main.yml
Normal file
14
_ansible/roles/extra_services/vars/main.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
extra_services_default:
|
||||
- domain: cloud-old.serguzim.me
|
||||
docker_host: host.docker.internal
|
||||
port: 3015
|
||||
caddy_extra: |
|
||||
redir /.well-known/host-meta /public.php?service=host-meta 301
|
||||
redir /.well-known/host-meta.json /public.php?service=host-meta-json 301
|
||||
redir /.well-known/webfinger /public.php?service=webfinger 301
|
||||
redir /.well-known/carddav /remote.php/dav/ 301
|
||||
redir /.well-known/caldav /remote.php/dav/ 301
|
||||
|
||||
extra_services_hidden: "{{ vault_extra_services }}"
|
||||
extra_services_all: "{{ extra_services_default | union(extra_services_hidden) }}"
|
|
@ -18,6 +18,8 @@
|
|||
handle {
|
||||
{% if svc.faas_function|default(false) %}
|
||||
import faas {{ svc.faas_function }}
|
||||
{% elif svc.redirect|default(false) %}
|
||||
redir "{{ svc.redirect }}"
|
||||
{% else %}
|
||||
reverse_proxy {{ svc.docker_host|default(svc.name) }}:{{ svc.port }}
|
||||
{% endif %}
|
||||
|
|
Reference in a new issue