From f879af0c3d5ebffecae6b75f30816f196642eff5 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sat, 6 Apr 2024 16:23:17 +0200 Subject: [PATCH] Allow setting the SENTRY_DNS As we use our contests to test `main` most of the time we should gather all encountered errors often, this makes this a bit easier. --- .../ansible/group_vars/all/secret.yml.example | 3 +++ .../ansible/roles/domserver/tasks/main.yml | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/provision-contest/ansible/group_vars/all/secret.yml.example b/provision-contest/ansible/group_vars/all/secret.yml.example index 2b1a0932..8e86e0ef 100644 --- a/provision-contest/ansible/group_vars/all/secret.yml.example +++ b/provision-contest/ansible/group_vars/all/secret.yml.example @@ -66,3 +66,6 @@ CDS_CONTESTS: password: admin PRESCLIENT_CONTEST: nwerc18 + +# Sentry DSN URL +# SENTRY_DSN: diff --git a/provision-contest/ansible/roles/domserver/tasks/main.yml b/provision-contest/ansible/roles/domserver/tasks/main.yml index 57415436..28bb5df3 100644 --- a/provision-contest/ansible/roles/domserver/tasks/main.yml +++ b/provision-contest/ansible/roles/domserver/tasks/main.yml @@ -112,3 +112,14 @@ loop: - nginx - php{{ php_version.stdout }}-fpm + +- name: Send errors to Sentry + lineinfile: + regexp: '^SENTRY_DSN=' + state: present + line: "SENTRY_DSN={{ SENTRY_DSN | default('') }}" + dest: "{{ DJ_DIR }}/webapp/.env.local" + create: true + mode: 0664 + group: domjudge + owner: domjudge