You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.3 KiB
41 lines
1.3 KiB
- block:
|
|
- name: fail if more than one reverse proxy config was collected
|
|
fail:
|
|
msg: more than one reverse proxy config was collected, this is not supported yet
|
|
when: rproxy_collected_configs | length > 1
|
|
|
|
|
|
- name: install nginx
|
|
include_role:
|
|
name: nginx
|
|
vars:
|
|
nginx:
|
|
servers:
|
|
- conf: rproxy_collected_configs[0].nginx
|
|
certs: "{{ host_tls }}"
|
|
acme_server: "{{ (rproxy_collected_configs[0].acme | d({}))['server'] | d(None) }}"
|
|
when: reverse_proxy_type == 'nginx'
|
|
|
|
|
|
- name: install caddy
|
|
include_role:
|
|
name: caddy
|
|
vars:
|
|
caddy_config: "{{ rproxy_collected_configs[0].caddy | d({}) }}"
|
|
caddy_reverse_proxy_handlers: "{{ rproxy_collected_configs[0].caddy_reverse_proxy_handlers | d([]) }}"
|
|
when: reverse_proxy_type == 'caddy'
|
|
|
|
|
|
- name: add firewall entries
|
|
include_role:
|
|
name: iptables
|
|
tasks_from: add.yml
|
|
vars:
|
|
firewall_config:
|
|
filter:
|
|
input:
|
|
- { protocol: tcp, dst_port: [80, 443], action: accept }
|
|
- { protocol: udp, dst_port: [80, 443], action: accept }
|
|
|
|
when: rproxy_collected_configs is defined and rproxy_collected_configs | length > 0
|
|
and role_use_reverse_proxy | d(true) == true
|
|
|