diff --git a/provision-contest/ansible/glitchtip.yml b/provision-contest/ansible/glitchtip.yml index 145168ab..a9673f7c 100644 --- a/provision-contest/ansible/glitchtip.yml +++ b/provision-contest/ansible/glitchtip.yml @@ -1,5 +1,4 @@ --- - - hosts: glitchtip vars: host_type: glitchtip @@ -7,15 +6,15 @@ handlers: - include_tasks: handlers.yml roles: - # - role: base_packages - # tags: base_packages - # - role: icpc_fixes - # tags: icpc_fixes - # when: ICPC_IMAGE - # - role: system_fixes - # tags: system_fixes - # - role: hosts - # tags: hosts + - role: base_packages + tags: base_packages + - role: icpc_fixes + tags: icpc_fixes + when: ICPC_IMAGE + - role: system_fixes + tags: system_fixes + - role: hosts + tags: hosts - role: docker tags: docker - role: glitchtip diff --git a/provision-contest/ansible/roles/docker/files/containers-glitchtip/glitchtip/.gitignore b/provision-contest/ansible/roles/docker/files/containers-glitchtip/glitchtip/.gitignore index e69de29b..72e8ffc0 100644 --- a/provision-contest/ansible/roles/docker/files/containers-glitchtip/glitchtip/.gitignore +++ b/provision-contest/ansible/roles/docker/files/containers-glitchtip/glitchtip/.gitignore @@ -0,0 +1 @@ +* diff --git a/provision-contest/ansible/roles/docker/tasks/load-container.yml b/provision-contest/ansible/roles/docker/tasks/load-container.yml index 50344235..1f4c6df2 100644 --- a/provision-contest/ansible/roles/docker/tasks/load-container.yml +++ b/provision-contest/ansible/roles/docker/tasks/load-container.yml @@ -1,33 +1,35 @@ --- -- block: - - name: Check for existing container - community.docker.docker_image_info: - name: "{{ img_name }}" - register: result +- name: Load the container from archive if needed + block: + - name: Check for existing container + community.docker.docker_image_info: + name: "{{ img_name }}" + register: result - - block: - - name: Create temp container directory - file: - path: /tmp/dj_ansible - state: directory - owner: root - group: root - mode: 0700 + - name: Transfer and load the container + block: + - name: Create temp container directory + file: + path: /tmp/dj_ansible + state: directory + owner: root + group: root + mode: 0700 - - name: Transfer container archive - copy: - src: "{{ item.src }}" - dest: "{{ img_path }}" - owner: root - group: root - mode: 0700 + - name: Transfer container archive + copy: + src: "{{ item.src }}" + dest: "{{ img_path }}" + owner: root + group: root + mode: 0700 - - name: Import container from archive - community.docker.docker_image: - name: "{{ img_name }}" - load_path: "{{ img_path }}" - source: load - when: not result.images + - name: Import container from archive + community.docker.docker_image: + name: "{{ img_name }}" + load_path: "{{ img_path }}" + source: load + when: not result.images vars: img_name: "{{ item.path | splitext | first }}" img_path: "/tmp/dj_ansible/{{ item.path | basename }}" diff --git a/provision-contest/ansible/roles/docker/tasks/main.yml b/provision-contest/ansible/roles/docker/tasks/main.yml index b68585d3..c9fefb38 100644 --- a/provision-contest/ansible/roles/docker/tasks/main.yml +++ b/provision-contest/ansible/roles/docker/tasks/main.yml @@ -20,10 +20,7 @@ - docker-ce-cli - docker-compose-plugin - python3-pip - -- name: Install Docker module for Python - pip: - name: docker + - python3-docker - name: Remove executable bit from "/usr/local/bin/runc" file: diff --git a/provision-contest/ansible/roles/glitchtip/defaults/main.yml b/provision-contest/ansible/roles/glitchtip/defaults/main.yml index 47b7b069..b09e4f05 100644 --- a/provision-contest/ansible/roles/glitchtip/defaults/main.yml +++ b/provision-contest/ansible/roles/glitchtip/defaults/main.yml @@ -1 +1 @@ -glitchtip_port: 8000 +GLITCHTIP_PORT: 8000 diff --git a/provision-contest/ansible/roles/glitchtip/handlers/main.yml b/provision-contest/ansible/roles/glitchtip/handlers/main.yml index 0abb5186..61571dfd 100644 --- a/provision-contest/ansible/roles/glitchtip/handlers/main.yml +++ b/provision-contest/ansible/roles/glitchtip/handlers/main.yml @@ -3,5 +3,5 @@ community.docker.docker_compose_v2: project_src: /opt/glitchtip files: - - docker-compose.yaml + - docker-compose.yaml state: restarted diff --git a/provision-contest/ansible/roles/glitchtip/templates/docker-compose.yaml.j2 b/provision-contest/ansible/roles/glitchtip/templates/docker-compose.yaml.j2 index 25f6c1ca..b36fe45a 100644 --- a/provision-contest/ansible/roles/glitchtip/templates/docker-compose.yaml.j2 +++ b/provision-contest/ansible/roles/glitchtip/templates/docker-compose.yaml.j2 @@ -3,10 +3,10 @@ x-environment: &default-environment DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres - SECRET_KEY: {{GLITCHTIP_SECRET}} - PORT: {{glitchtip_port}} + SECRET_KEY: {{ GLITCHTIP_SECRET }} + PORT: {{ GLITCHTIP_PORT}} EMAIL_URL: consolemail:// - GLITCHTIP_DOMAIN: http://glitchtip:{{glitchtip_port}} + GLITCHTIP_DOMAIN: http://glitchtip:{{ GLITCHTIP_PORT }} DEFAULT_FROM_EMAIL: email@glitchtip CELERY_WORKER_AUTOSCALE: "1,1" CELERY_WORKER_MAX_TASKS_PER_CHILD: "1000" @@ -31,7 +31,7 @@ services: image: glitchtip/glitchtip:v4.1.3 depends_on: *default-depends_on ports: - - {{glitchtip_port}}:{{glitchtip_port}} + - {{ GLITCHTIP_PORT }}:{{ GLITCHTIP_PORT }} environment: *default-environment restart: unless-stopped volumes: