Skip to content

Commit 8ef0121

Browse files
committed
Use default python3 modules and run the default roles
Also fixed indendation and styling
1 parent 3a498c6 commit 8ef0121

File tree

7 files changed

+45
-46
lines changed

7 files changed

+45
-46
lines changed

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

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
---
2-
32
- hosts: glitchtip
43
vars:
54
host_type: glitchtip
65
become: true
76
handlers:
87
- include_tasks: handlers.yml
98
roles:
10-
# - role: base_packages
11-
# tags: base_packages
12-
# - role: icpc_fixes
13-
# tags: icpc_fixes
14-
# when: ICPC_IMAGE
15-
# - role: system_fixes
16-
# tags: system_fixes
17-
# - role: hosts
18-
# tags: hosts
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
1918
- role: docker
2019
tags: docker
2120
- role: glitchtip
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
---
2-
- block:
3-
- name: Check for existing container
4-
community.docker.docker_image_info:
5-
name: "{{ img_name }}"
6-
register: result
2+
- name: Load the container from archive if needed
3+
block:
4+
- name: Check for existing container
5+
community.docker.docker_image_info:
6+
name: "{{ img_name }}"
7+
register: result
78

8-
- block:
9-
- name: Create temp container directory
10-
file:
11-
path: /tmp/dj_ansible
12-
state: directory
13-
owner: root
14-
group: root
15-
mode: 0700
9+
- name: Transfer and load the container
10+
block:
11+
- name: Create temp container directory
12+
file:
13+
path: /tmp/dj_ansible
14+
state: directory
15+
owner: root
16+
group: root
17+
mode: 0700
1618

17-
- name: Transfer container archive
18-
copy:
19-
src: "{{ item.src }}"
20-
dest: "{{ img_path }}"
21-
owner: root
22-
group: root
23-
mode: 0700
19+
- name: Transfer container archive
20+
copy:
21+
src: "{{ item.src }}"
22+
dest: "{{ img_path }}"
23+
owner: root
24+
group: root
25+
mode: 0700
2426

25-
- name: Import container from archive
26-
community.docker.docker_image:
27-
name: "{{ img_name }}"
28-
load_path: "{{ img_path }}"
29-
source: load
30-
when: not result.images
27+
- name: Import container from archive
28+
community.docker.docker_image:
29+
name: "{{ img_name }}"
30+
load_path: "{{ img_path }}"
31+
source: load
32+
when: not result.images
3133
vars:
3234
img_name: "{{ item.path | splitext | first }}"
3335
img_path: "/tmp/dj_ansible/{{ item.path | basename }}"

Diff for: provision-contest/ansible/roles/docker/tasks/main.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
- docker-ce-cli
2121
- docker-compose-plugin
2222
- python3-pip
23-
24-
- name: Install Docker module for Python
25-
pip:
26-
name: docker
23+
- python3-docker
2724

2825
- name: Remove executable bit from "/usr/local/bin/runc"
2926
file:
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
glitchtip_port: 8000
1+
GLITCHTIP_PORT: 8000

Diff for: provision-contest/ansible/roles/glitchtip/handlers/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
community.docker.docker_compose_v2:
44
project_src: /opt/glitchtip
55
files:
6-
- docker-compose.yaml
6+
- docker-compose.yaml
77
state: restarted

Diff for: provision-contest/ansible/roles/glitchtip/templates/docker-compose.yaml.j2

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
x-environment:
44
&default-environment
55
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
6-
SECRET_KEY: {{GLITCHTIP_SECRET}}
7-
PORT: {{glitchtip_port}}
6+
SECRET_KEY: {{ GLITCHTIP_SECRET }}
7+
PORT: {{ GLITCHTIP_PORT}}
88
EMAIL_URL: consolemail://
9-
GLITCHTIP_DOMAIN: http://glitchtip:{{glitchtip_port}}
9+
GLITCHTIP_DOMAIN: http://glitchtip:{{ GLITCHTIP_PORT }}
1010
DEFAULT_FROM_EMAIL: email@glitchtip
1111
CELERY_WORKER_AUTOSCALE: "1,1"
1212
CELERY_WORKER_MAX_TASKS_PER_CHILD: "1000"
@@ -31,7 +31,7 @@ services:
3131
image: glitchtip/glitchtip:v4.1.3
3232
depends_on: *default-depends_on
3333
ports:
34-
- {{glitchtip_port}}:{{glitchtip_port}}
34+
- {{ GLITCHTIP_PORT }}:{{ GLITCHTIP_PORT }}
3535
environment: *default-environment
3636
restart: unless-stopped
3737
volumes:

0 commit comments

Comments
 (0)