Skip to content

Commit dffb464

Browse files
committed
[shlink] Add option to configure multiple domains
1 parent 8bd385f commit dffb464

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

site.maintenance.service.shlink.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,8 @@
5353

5454
nginx_blacklist_vhost_check_include_file: ~
5555

56-
https_termination_hosts:
57-
- name: "{{ shlink_short_domain }}"
58-
server_name: "{{ shlink_short_domain }}"
59-
letsencrypt: yes
56+
https_termination_hosts: []
57+
6058
https_termination_proxy_http_port: yes
6159

6260
https_termination_upstream_host: 127.0.0.1
@@ -66,6 +64,22 @@
6664
https_termination_crt_acme_email: [email protected]
6765

6866
pre_tasks:
67+
- name: Initialize short domain list
68+
set_fact:
69+
shlink_domains: "{{ [shlink_short_domain] + shlink_short_domains_extra | default([]) }}"
70+
71+
- name: Compute vhost configuration
72+
set_fact:
73+
https_termination_hosts: "{{ https_termination_hosts + [host] }}"
74+
vars:
75+
host:
76+
name: "{{ domain }}"
77+
server_name: "{{ domain }}"
78+
letsencrypt: yes
79+
loop: "{{ shlink_domains }}"
80+
loop_control:
81+
loop_var: domain
82+
6983
- name: Automatically configure MySQL host as RDS instance
7084
when: >-
7185
aws_use

0 commit comments

Comments
 (0)