@@ -1,2 +1,4 @@ | |||||
--- | --- | ||||
alerta_server_name: "{{ inventory_hostname }}" | alerta_server_name: "{{ inventory_hostname }}" | ||||
alerta_secret_key: "{{ ansible_local.alerta.secret_key }}" |
@@ -0,0 +1,17 @@ | |||||
--- | |||||
- name: ansible local facts directory | |||||
file: | |||||
path: /etc/ansible/facts.d | |||||
state: directory | |||||
- name: set ansible local fact | |||||
copy: | |||||
content: "{{_local_facts|to_json}}" | |||||
dest: /etc/ansible/facts.d/{{role_name}}.fact | |||||
mode: 0600 | |||||
register: _local_facts_set | |||||
- name: Gathering Facts | |||||
setup: | |||||
when: _local_facts_set.changed |
@@ -1,4 +1,6 @@ | |||||
--- | --- | ||||
- import_tasks: local_facts.yaml | |||||
- name: debian package requirements | - name: debian package requirements | ||||
apt: | apt: | ||||
@@ -82,6 +84,12 @@ | |||||
dest: /opt/alerta/wsgi.py | dest: /opt/alerta/wsgi.py | ||||
notify: restart uwsgi | notify: restart uwsgi | ||||
- name: alerta configuration | |||||
template: | |||||
src: alertad.conf.j2 | |||||
dest: /etc/alertad.conf | |||||
notify: restart uwsgi | |||||
- include_role: | - include_role: | ||||
name: certificate | name: certificate | ||||
vars: | vars: | ||||
@@ -0,0 +1,3 @@ | |||||
{{ansible_managed|comment}} | |||||
SECRET_KEY = '{{alerta_secret_key}}' | |||||
BASE_URL = '/api' |
@@ -1,4 +1,7 @@ | |||||
--- | --- | ||||
_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_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_webui_version: "{{ _alerta_webui_releases.json.tag_name }}" | ||||