-
Notifications
You must be signed in to change notification settings - Fork 1
/
validator.yml
114 lines (101 loc) · 2.48 KB
/
validator.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
- name: rm stack
shell: docker stack rm validator
- name: clean host
shell: docker {{ item }} prune -f
with_items:
- container
- volume
- name: create json mosquitto data folder
become: true
file:
path: /home/ubuntu/validator/json-mosquitto/data/
state: "{{ item }}"
owner: 1883
group: ubuntu
with_items:
- absent
- directory
- name: create json mosquitto log folder
become: true
file:
path: /home/ubuntu/validator/json-mosquitto/log/
state: "{{ item }}"
owner: 1883
group: ubuntu
with_items:
- absent
- directory
- name: create ul mosquitto data folder
become: true
file:
path: /home/ubuntu/validator/ul-mosquitto/data/
state: "{{ item }}"
owner: 1883
group: ubuntu
with_items:
- absent
- directory
- name: create ul mosquitto log folder
become: true
file:
path: /home/ubuntu/validator/ul-mosquitto/log/
state: "{{ item }}"
owner: 1883
group: ubuntu
with_items:
- absent
- directory
- name: create mongo folder
become: true
file:
path: /home/ubuntu/validator/mongo
state: "{{ item }}"
owner: 999
group: ubuntu
with_items:
- absent
- directory
- name: create nginx folder
become: true
file:
path: /home/ubuntu/validator/nginx
state: "{{ item }}"
owner: 999
group: ubuntu
with_items:
- absent
- directory
- name: copy docker-compose
copy:
src: validator/docker-compose.yml
dest: /home/ubuntu/validator/docker-compose.yml
- name: pull images
shell: docker-compose pull
args:
chdir: /home/ubuntu/validator/
- name: sync files
become: true
synchronize:
src: validator/
dest: /home/ubuntu/validator/static/
delete: true
- name: run stack
shell: docker stack deploy --compose-file docker-compose.yml validator
args:
chdir: /home/ubuntu/validator
- name: check if mongo up
shell: docker service logs validator_mongo 2>&1 | sed 's/"//g'
register: test
until: test.stdout.find('waiting for connections on port 27017') != -1
delay: 7
retries: 7
- name: check if orion up
shell: docker run -it --rm --network validator caa06d9c/support curl {{ item }}-orion:1026/version
register: test
until: test.stdout.find('orion') != -1
delay: 7
retries: 7
with_items:
- ul
- json