-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproxies.yml
47 lines (46 loc) · 1.82 KB
/
proxies.yml
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
- hosts:
- proxies
no_log: true
vars_files:
- ./config/supabase.yml
- ./config/servers.yml
vars:
# do not worry. these ports are local
config_local_xray_metrics_port: 8081
config_local_node_exporter_metrics_port: 8082
config_local_xray_exporter_metrics_port: 8080
pre_tasks:
- name: Fetch configs UUIDs from Supabase
delegate_to: localhost
uri:
url: "https://{{ config_supabase_project_id }}.supabase.co/rest/v1/configs?select=uuid"
method: GET
headers:
apikey: "{{ config_supabase_api_key }}"
Authorization: "Bearer {{ config_supabase_api_key }}"
register: supabase_configs_response
- name: Set user UUIDs fact
delegate_to: localhost
set_fact:
config_local_configs: "{{ supabase_configs_response.json | map(attribute='uuid') | list }}"
roles:
- role: xray
vars:
xray_server_uuid: "{{ hosts_server_uuid }}"
xray_server: "{{ config_servers[xray_server_uuid] }}"
xray_configs: "{{ config_local_configs }}"
xray_metrics_port: "{{ config_local_xray_metrics_port }}"
xray_supabase_api_key: "{{ supabase_api_key }}"
xray_supabase_project_id: "{{ supabase_project_id }}"
- role: node-exporter
vars:
node_exporter_port: "{{ config_local_node_exporter_metrics_port }}"
- role: xray-exporter
vars:
xray_exporter_port: "{{ config_local_xray_exporter_metrics_port }}"
xray_exporter_fetch_port: "{{ config_local_xray_metrics_port }}"
- role: metrics-exporter
vars:
metrics_exporter_server: "{{ config_servers[hosts_server_uuid] }}"
metrics_exporter_node_exporter_metrics_port: "{{ config_local_node_exporter_metrics_port }}"
metrics_exporter_xray_metrics_port: "{{ config_local_xray_exporter_metrics_port }}"