Files
ansible-general/roles/reverse_proxy/tasks/main.yml
2022-05-13 23:24:58 +03:00

23 lines
787 B
YAML

---
- block:
- name: Split legacy proxy_target to protocol, host and port
set_fact:
proxy_target_split_protocol: "{{ proxy_target.split('://') }}"
- set_fact:
proxy_target_split_host: "{{ (proxy_target_split_protocol | last).split(':') }}"
- set_fact:
proxy_target_host: "{{ proxy_target_split_host[0] }}"
proxy_target_port: "{{ proxy_target_split_host[1] }}"
- name: Set proxy_target_protocol based on proxy_target
set_fact:
proxy_target_protocol: "{{ proxy_target_split_protocol[0] }}"
when: proxy_target_split_protocol | length == 2
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'