Deprecate reverse_proxy role as all functionality is available in vhost

This commit is contained in:
uumas
2022-11-18 05:38:40 +02:00
parent 3974e6eb46
commit e27c8e8cf3
6 changed files with 16 additions and 32 deletions

View File

@@ -1,20 +0,0 @@
---
- name: Add caddy reverse proxy config
blockinfile:
path: /etc/caddy/Caddyfile
marker: "# {mark} ANSIBLE MANAGED BLOCK {{ vhost_id }}"
block: |
{{ vhost_domains | join(' ') }} {
reverse_proxy {{ proxy_target_protocol }}://{{ proxy_target_host }}:{{ proxy_target_port }} {
{% if proxy_target_protocol == 'https' and proxy_target_host == 'localhost' %}
transport http {
tls_insecure_skip_verify
}
{% endif %}
}
}
validate: 'caddy validate --config %s --adapter caddyfile'
backup: true
notify: reload caddy

View File

@@ -1,5 +1,9 @@
---
- name: Deprecation warning
debug:
msg: "uumas.general.reverse_proxy is deprecated. You should switch to uumas.general.vhost with vhost_type: reverse_proxy"
- block:
- name: Split legacy proxy_target to protocol, host and port
set_fact:
@@ -17,6 +21,9 @@
when: proxy_target is defined and proxy_target_port is not defined
- name: Setup {{ vhost_id }} reverse proxy
include_tasks: "{{ reverse_proxy_type }}.yml"
when: reverse_proxy_type != 'none'
- name: configure vhost for reverse proxy
include_role:
name: vhost
vars:
vhost_type: reverse_proxy