No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

110 líneas
2.3KB

  1. ---
  2. - import_tasks: local_facts.yaml
  3. - name: debian package requirements
  4. apt:
  5. pkg:
  6. - uwsgi
  7. - uwsgi-plugin-python3
  8. - import_role:
  9. name: mongodb
  10. - name: alerta server pip package
  11. pip:
  12. name: alerta-server
  13. executable: pip3
  14. notify: restart uwsgi
  15. - name: alerta client pip package
  16. pip:
  17. name: alerta
  18. executable: pip3
  19. - name: alerta installation directory
  20. file:
  21. path: /opt/alerta
  22. state: directory
  23. - name: alerta-webui installation directory
  24. file:
  25. path: /opt/alerta/webui
  26. state: directory
  27. - name: get alerta-webui releases
  28. uri:
  29. url: https://api.github.com/repos/alerta/alerta-webui/releases/latest
  30. return_content: true
  31. register: _alerta_webui_releases
  32. - name: download latest alerta-webui release
  33. get_url:
  34. url: "{{_alerta_webui_dl_url}}"
  35. dest: /opt/alerta/webui/alerta-webui-{{_alerta_webui_version}}.tar.gz
  36. - name: extract alerta-webui release
  37. unarchive:
  38. src: /opt/alerta/webui/alerta-webui-{{_alerta_webui_version}}.tar.gz
  39. dest: /opt/alerta/webui
  40. mode: u=rwx,g=rx,o=rx
  41. owner: root
  42. group: root
  43. remote_src: true
  44. - name: alerta-webui config
  45. copy:
  46. content: "{{alerta_webui_config}}"
  47. dest: /opt/alerta/config.json
  48. - name: alerta user
  49. user:
  50. name: alerta
  51. system: yes
  52. home: /
  53. register: _alerta_user
  54. - name: alerta uwsgi configuration
  55. copy:
  56. content:
  57. uwsgi: "{{alerta_uwsgi_config}}"
  58. dest: /etc/uwsgi/apps-available/alerta.json
  59. notify: restart uwsgi
  60. - name: enable alerta uwsgi configuration
  61. file:
  62. src: ../apps-available/alerta.json
  63. dest: /etc/uwsgi/apps-enabled/alerta.json
  64. state: link
  65. notify: restart uwsgi
  66. - name: alerta wsgi python file
  67. copy:
  68. content: from alerta import app
  69. dest: /opt/alerta/wsgi.py
  70. notify: restart uwsgi
  71. - name: alerta configuration
  72. template:
  73. src: alertad.conf.j2
  74. dest: /etc/alertad.conf
  75. notify: restart uwsgi
  76. - include_role:
  77. name: certificate
  78. vars:
  79. certificate_name: alerta
  80. certificate_directory: /etc/ssl
  81. certificate_key_usage:
  82. - digitalSignature
  83. - keyEncipherment
  84. certificate_extended_key_usage:
  85. - serverAuth
  86. certificate_alt_names:
  87. - "{{ alerta_server_name | regex_replace( '(.*)','DNS:\\1' ) }}"
  88. - include_role:
  89. name: nginx
  90. vars:
  91. nginx_vhosts: "{{ alerta_nginx_vhosts }}"