ctucx.git: ansible-configs

My personal ansible roles and playbooks [deprecated in favor of nixos]

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
#
# !!! This file is managed by Ansible !!!
#

{% if services.synapse.nginx.sslOnly is false %}
server {
	listen 80 ;
	listen [::]:80;
	
	server_name {{ services.synapse.nginx.domain }};

	{% if services.synapse.webClient.enable is defined and services.synapse.webClient.enable is true %}
	location /_matrix {
		proxy_pass http://127.0.0.1:8008;
		proxy_set_header X-Forwarded-For $remote_addr;
		client_max_body_size 100M;
	}

	{% if ansible_distribution == "Alpine" %}
	location / {
		{% if system.enableOwnRepos == true %}
		root /usr/share/webapps/schildichat-web;
		{% else %}
		root /usr/share/webapps/riot-web;		
		{% endif %}
	}
	{% else %}
	location / {
		root /usr/share/webapps/element;
	}
	{% endif %}
	{% else %}
	location / {
		proxy_pass http://127.0.0.1:8008;
		proxy_set_header X-Forwarded-For $remote_addr;
		client_max_body_size 100M;
	}
	{% endif %}

	{% if services.synapse.nginx.extraConfig is defined %}
	{{ services.synapse.nginx.extraConfig }}
	{% endif %}
}

{% endif %}
{% if services.synapse.nginx.ssl.enable is true %}
server {
	listen 443 ssl;
	listen [::]:443 ssl;

	ssl_certificate "{{ services.synapse.nginx.ssl.cert }}";
	ssl_certificate_key "{{ services.synapse.nginx.ssl.privkey }}";
	include /etc/nginx/ssl.conf;
	
	server_name {{ services.synapse.nginx.domain }};

	{% if services.synapse.webClient.enable is defined and services.synapse.webClient.enable is true %}
	location /_matrix {
		proxy_pass http://127.0.0.1:8008;
		proxy_set_header X-Forwarded-For $remote_addr;
		client_max_body_size 100M;
	}

	{% if ansible_distribution == "Alpine" %}
	location / {
		root /usr/share/webapps/schildichat-web;
	}
	{% else %}
	location / {
		root /usr/share/webapps/element;
	}
	{% endif %}
	{% else %}
	location / {
		proxy_pass http://127.0.0.1:8008;
		proxy_set_header X-Forwarded-For $remote_addr;
		client_max_body_size 100M;
	}
	{% endif %}

	{% if services.synapse.nginx.extraConfig is defined %}
	{{ services.synapse.nginx.extraConfig }}
	{% endif %}
}
{% endif %}