|
- ---
- _local_facts:
- secret_key: "{% if not ansible_local[role_name].secret_key is defined %}{{ lookup('password', '/dev/null length=64 chars=ascii_letters,digits') }}{% else %}{{ ansible_local[role_name].secret_key }}{% endif %}"
-
- _alerta_webui_dl_url: "{{ _alerta_webui_releases.json.assets | json_query(\"[?name=='alerta-webui.tar.gz'].browser_download_url|[0]\") }}"
- _alerta_webui_version: "{{ _alerta_webui_releases.json.tag_name }}"
-
- alerta_uwsgi_config:
- uid: alerta
- gid: alerta
- chdir: /opt/alerta
- mount: /api=wsgi.py
- callable: app
- manage-script-name: true
- env: BASE_URL=/api
- buffer-size: 32768
- plugin: python3
-
- alerta_webui_config:
- endpoint: /api
-
- alerta_nginx_vhosts:
- - name: alerta
- server_names:
- - "{{ alerta_server_name }}"
- custom: |-
- root /opt/alerta/webui/dist;
- index index.html;
-
- location /api { try_files $uri @api; }
- location @api {
- include uwsgi_params;
- uwsgi_pass unix:/run/uwsgi/app/alerta/socket;
- proxy_set_header Host $host:$server_port;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
- location /config.json { alias /opt/alerta/config.json; }
- location / {
- try_files $uri $uri/ /index.html;
- }
|