Skip to content

Commit 5cd0266

Browse files
authored
Merge pull request #259 from data-tangles:dev
Add playbook for deploying Komodo containers
2 parents 332f127 + 5d22866 commit 5cd0266

2 files changed

Lines changed: 90 additions & 0 deletions

File tree

playbooks/komodo_install.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- hosts: "{{ nodes }}"
2+
become: yes
3+
become_method: sudo
4+
gather_facts: yes
5+
roles:
6+
- ../roles/docker_komodo

roles/docker_komodo/tasks/main.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
- name: deploy Komodo Container Network
2+
docker_network:
3+
name: "komodo"
4+
5+
- name: Create Komodo DB Data Volume
6+
community.docker.docker_volume:
7+
name: komodo-db-data
8+
9+
- name: Create Komodo DB Config Volume
10+
community.docker.docker_volume:
11+
name: komodo-db-config
12+
13+
- name: deploy Komodo DB Container
14+
docker_container:
15+
name: "komodo-db"
16+
image: "mongo"
17+
restart_policy: always
18+
networks:
19+
- name: "komodo"
20+
volumes:
21+
- "/etc/localtime:/etc/localtime:ro"
22+
- "komodo-db-data:/data/db"
23+
- "komodo-db-config:/data/configdb"
24+
env:
25+
MONGO_INITDB_ROOT_USERNAME: "{{ KOMODO_DB_USERNAME }}"
26+
MONGO_INITDB_ROOT_PASSWORD: "{{ KOMODO_DB_PASSWORD }}"
27+
labels:
28+
komodo.skip:
29+
30+
- name: Create Komodo Core Data Volume
31+
community.docker.docker_volume:
32+
name: komodo-core-data
33+
34+
- name: deploy Komodo Core Container
35+
docker_container:
36+
name: "komodo-core"
37+
image: "ghcr.io/moghtech/komodo-core:latest"
38+
restart_policy: always
39+
networks:
40+
- name: "komodo"
41+
- name: "proxy"
42+
volumes:
43+
- "/etc/localtime:/etc/localtime:ro"
44+
- "komodo-core-data:/backups"
45+
env:
46+
KOMODO_DATABASE_ADDRESS: komodo-db:27017
47+
KOMODO_FIRST_SERVER: https://komodo-periphery:8120
48+
KOMODO_DATABASE_USERNAME: "{{ KOMODO_DB_USERNAME }}"
49+
KOMODO_DATABASE_PASSWORD: "{{ KOMODO_DB_PASSWORD }}"
50+
KOMODO_PASSKEY: "{{ KOMODO_PASSKEY }}"
51+
KOMODO_HOST: "{{ KOMODO_HOST }}"
52+
KOMODO_LOCAL_AUTH: "true"
53+
KOMODO_INIT_ADMIN_USERNAME: "{{ KOMODO_INIT_ADMIN_USERNAME }}"
54+
KOMODO_INIT_ADMIN_PASSWORD: "{{ KOMODO_INIT_ADMIN_PASSWORD }}"
55+
labels:
56+
komodo.skip:
57+
traefik.enable: "true"
58+
traefik.http.routers.komodo.entrypoints: "http"
59+
traefik.http.routers.komodo.rule: "Host(`{{ komodo_url }}`)"
60+
traefik.http.middlewares.komodo-https-redirect.redirectscheme.scheme: "https"
61+
traefik.http.routers.komodo.middlewares: "komodo-https-redirect"
62+
traefik.http.routers.komodo-secure.entrypoints: "https"
63+
traefik.http.routers.komodo-secure.rule: "Host(`{{ komodo_url }}`)"
64+
traefik.http.routers.komodo-secure.tls: "true"
65+
traefik.http.routers.komodo-secure.service: "komodo"
66+
traefik.http.services.komodo.loadbalancer.server.port: "9120"
67+
traefik.docker.network: "proxy"
68+
69+
- name: deploy Komodo Periphery Container
70+
docker_container:
71+
name: "komodo-periphery"
72+
image: "ghcr.io/moghtech/komodo-periphery:latest"
73+
restart_policy: always
74+
networks:
75+
- name: "komodo"
76+
volumes:
77+
- "/etc/localtime:/etc/localtime:ro"
78+
- "/var/run/docker.sock:/var/run/docker.sock"
79+
- "/proc:/proc"
80+
env:
81+
KOMODO_PASSKEY: "{{ KOMODO_PASSKEY }}"
82+
labels:
83+
komodo.skip:
84+

0 commit comments

Comments
 (0)