--- - import_tasks: local_facts.yaml - name: debian package requirements apt: pkg: - uwsgi - uwsgi-plugin-python3 - import_role: name: mongodb - name: alerta server pip package pip: name: alerta-server executable: pip3 notify: restart uwsgi - name: alerta client pip package pip: name: alerta executable: pip3 - name: alerta installation directory file: path: /opt/alerta state: directory - name: alerta-webui installation directory file: path: /opt/alerta/webui state: directory - name: get alerta-webui releases uri: url: https://api.github.com/repos/alerta/alerta-webui/releases/latest return_content: true register: _alerta_webui_releases - name: download latest alerta-webui release get_url: url: "{{_alerta_webui_dl_url}}" dest: /opt/alerta/webui/alerta-webui-{{_alerta_webui_version}}.tar.gz - name: extract alerta-webui release unarchive: src: /opt/alerta/webui/alerta-webui-{{_alerta_webui_version}}.tar.gz dest: /opt/alerta/webui mode: u=rwx,g=rx,o=rx owner: root group: root remote_src: true - name: alerta-webui config copy: content: "{{alerta_webui_config}}" dest: /opt/alerta/config.json - name: alerta user user: name: alerta system: yes home: / register: _alerta_user - name: alerta uwsgi configuration copy: content: uwsgi: "{{alerta_uwsgi_config}}" dest: /etc/uwsgi/apps-available/alerta.json notify: restart uwsgi - name: enable alerta uwsgi configuration file: src: ../apps-available/alerta.json dest: /etc/uwsgi/apps-enabled/alerta.json state: link notify: restart uwsgi - name: alerta wsgi python file copy: content: from alerta import app dest: /opt/alerta/wsgi.py notify: restart uwsgi - name: alerta configuration template: src: alertad.conf.j2 dest: /etc/alertad.conf notify: restart uwsgi - include_role: name: certificate vars: certificate_name: alerta certificate_directory: /etc/ssl certificate_key_usage: - digitalSignature - keyEncipherment certificate_extended_key_usage: - serverAuth certificate_alt_names: - "{{ alerta_server_name | regex_replace( '(.*)','DNS:\\1' ) }}" - include_role: name: nginx vars: nginx_vhosts: "{{ alerta_nginx_vhosts }}"