Skip to content

Commit 7f70315

Browse files
committed
Define GlitchTip installation role
In a later restructure of Ansible, the GlithTip role should become part of the admin role, just like the Grafana roles has to be merged in. Use the reusable Docker definitions to install Docker. In the compose stack, use the host CA bundle for a.o. uptime monitor as often custom certs are used on contest floors which must be trusted in the container.
1 parent 7f210cd commit 7f70315

File tree

10 files changed

+115
-1
lines changed

10 files changed

+115
-1
lines changed

Diff for: provision-contest/ansible/glitchtip.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
- hosts: glitchtip
3+
vars:
4+
host_type: glitchtip
5+
become: true
6+
handlers:
7+
- include_tasks: handlers.yml
8+
roles:
9+
- role: base_packages
10+
tags: base_packages
11+
- role: icpc_fixes
12+
tags: icpc_fixes
13+
when: ICPC_IMAGE
14+
- role: system_fixes
15+
tags: system_fixes
16+
- role: hosts
17+
tags: hosts
18+
- role: docker
19+
tags: docker
20+
- role: glitchtip
21+
tags: glitchtip

Diff for: provision-contest/ansible/group_vars/onprem/secret.yml.example

+3
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,6 @@ PRESCLIENT_CONTEST: nwerc18
6969

7070
# Sentry DSN URL
7171
# SENTRY_DSN:
72+
73+
# GlitchTip
74+
# GLITCHTIP_SECRET: {some-strong-glitchtip-password}

Diff for: provision-contest/ansible/hosts.example

+6-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ domjudge-ccsadmin5 ansible_host=10.3.3.227
6161
[grafana]
6262
# During the WFs we use one of the ccsadmin machines
6363
# Doesn't matter which (admin) machine but should not be 1 as that runs ansible
64-
domjudge-ccsadmin2 ansible_host=10.3.3.225
64+
domjudge-ccsadmin2 ansible_host=10.3.3.224
65+
66+
[glitchtip]
67+
# During the WFs we use one of the ccsadmin machines
68+
# Doesn't matter which (admin) machine but should not be 1 as that runs ansible
69+
domjudge-ccsadmin3 ansible_host=10.3.3.225
6570

6671
[cds]
6772
domjudge-cds ansible_host=10.2.2.228
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.tar
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GLITCHTIP_PORT: 8000
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
- name: Restart GlitchTip
3+
community.docker.docker_compose_v2:
4+
project_src: /opt/glitchtip
5+
files:
6+
- docker-compose.yaml
7+
state: restarted
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
- name: Create directories
3+
become_user: root
4+
file:
5+
path: /opt/glitchtip
6+
state: directory
7+
8+
- name: Create compose file
9+
template:
10+
src: templates/docker-compose.yaml.j2
11+
dest: /opt/glitchtip/docker-compose.yaml
12+
13+
- name: Deploy GlitchTip compose stack
14+
community.docker.docker_compose_v2:
15+
project_src: /opt/glitchtip
16+
files:
17+
- docker-compose.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Uncomment version if using an older version of docker compose
2+
# version: "3.8"
3+
x-environment:
4+
&default-environment
5+
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
6+
SECRET_KEY: {{ GLITCHTIP_SECRET }}
7+
PORT: {{ GLITCHTIP_PORT}}
8+
EMAIL_URL: consolemail://
9+
GLITCHTIP_DOMAIN: http://glitchtip:{{ GLITCHTIP_PORT }}
10+
DEFAULT_FROM_EMAIL: email@glitchtip
11+
CELERY_WORKER_AUTOSCALE: "1,1"
12+
CELERY_WORKER_MAX_TASKS_PER_CHILD: "1000"
13+
REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
14+
15+
x-depends_on:
16+
&default-depends_on
17+
- postgres
18+
- redis
19+
20+
services:
21+
postgres:
22+
image: postgres:16-alpine
23+
environment:
24+
POSTGRES_HOST_AUTH_METHOD: "trust" # Consider removing this and setting a password
25+
restart: unless-stopped
26+
volumes:
27+
- pg-data:/var/lib/postgresql/data
28+
redis:
29+
image: redis:7-alpine
30+
restart: unless-stopped
31+
web:
32+
image: glitchtip/glitchtip:v4.1.3
33+
depends_on: *default-depends_on
34+
ports:
35+
- {{ GLITCHTIP_PORT }}:{{ GLITCHTIP_PORT }}
36+
environment: *default-environment
37+
restart: unless-stopped
38+
volumes:
39+
- uploads:/code/uploads
40+
worker:
41+
image: glitchtip/glitchtip:v4.1.3
42+
command: ./bin/run-celery-with-beat.sh
43+
depends_on: *default-depends_on
44+
environment: *default-environment
45+
restart: unless-stopped
46+
volumes:
47+
- uploads:/code/uploads
48+
- /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro
49+
migrate:
50+
image: glitchtip/glitchtip:v4.1.3
51+
depends_on: *default-depends_on
52+
command: ./bin/run-migrate.sh
53+
environment: *default-environment
54+
55+
volumes:
56+
pg-data:
57+
uploads:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.yml

0 commit comments

Comments
 (0)