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.

42 lines
1.3KB

  1. ---
  2. _local_facts:
  3. 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 %}"
  4. _alerta_webui_dl_url: "{{ _alerta_webui_releases.json.assets | json_query(\"[?name=='alerta-webui.tar.gz'].browser_download_url|[0]\") }}"
  5. _alerta_webui_version: "{{ _alerta_webui_releases.json.tag_name }}"
  6. alerta_uwsgi_config:
  7. uid: alerta
  8. gid: alerta
  9. chdir: /opt/alerta
  10. mount: /api=wsgi.py
  11. callable: app
  12. manage-script-name: true
  13. env: BASE_URL=/api
  14. buffer-size: 32768
  15. plugin: python3
  16. alerta_webui_config:
  17. endpoint: /api
  18. alerta_nginx_vhosts:
  19. - name: alerta
  20. server_names:
  21. - "{{ alerta_server_name }}"
  22. custom: |-
  23. root /opt/alerta/webui/dist;
  24. index index.html;
  25. location /api { try_files $uri @api; }
  26. location @api {
  27. include uwsgi_params;
  28. uwsgi_pass unix:/run/uwsgi/app/alerta/socket;
  29. proxy_set_header Host $host:$server_port;
  30. proxy_set_header X-Real-IP $remote_addr;
  31. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  32. }
  33. location /config.json { alias /opt/alerta/config.json; }
  34. location / {
  35. try_files $uri $uri/ /index.html;
  36. }