-
Notifications
You must be signed in to change notification settings - Fork 1
/
showcase.yml
132 lines (115 loc) · 3.17 KB
/
showcase.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
---
- name: rm stack
shell: docker stack rm zerodefects
- name: clean host
shell: docker {{ item }} prune -f
with_items:
- container
- volume
- name: create crate folder
file:
path: /home/ubuntu/showcase/crate
state: "{{ item }}"
owner: ubuntu
group: ubuntu
with_items:
- absent
- directory
- name: create grafana folder
become: true
file:
path: /home/ubuntu/showcase/grafana/
state: "{{ item }}"
owner: 472
group: ubuntu
with_items:
- absent
- directory
- name: create mongo folder
become: true
file:
path: /home/ubuntu/showcase/mongo
state: "{{ item }}"
owner: 999
group: ubuntu
with_items:
- absent
- directory
- name: copy docker-compose
copy:
src: showcase/docker-compose.yml
dest: /home/ubuntu/showcase/docker-compose.yml
- name: pull images
shell: docker-compose pull
args:
chdir: /home/ubuntu/showcase/
- name: copy grafana dynamic
become: true
synchronize:
src: showcase/dynamic/
dest: /home/ubuntu/showcase/grafana/
delete: true
- name: change perms
become: true
file:
dest: /home/ubuntu/showcase/grafana/
owner: 472
group: ubuntu
recurse: yes
- name: sync files
become: true
synchronize:
src: showcase/static/
dest: /home/ubuntu/showcase/static/
delete: true
- name: run stack
shell: docker stack deploy --compose-file docker-compose.yml zerodefects
args:
chdir: /home/ubuntu/showcase
- name: check if mongo up
shell: docker service logs zerodefects_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 showcase caa06d9c/support curl orion-{{ item }}:1026/version
register: test
until: test.stdout.find('orion') != -1
delay: 7
retries: 7
with_items:
- gf
- innovalia
- shopfloor
- name: check if quantumleap up
shell: docker service logs zerodefects_quantumleap 2>&1 | sed 's/"//g'
register: test
until: test.stdout.find('Running on') != -1
delay: 7
retries: 7
- name: check if crate up
shell: docker service logs zerodefects_crate 2>&1 | sed 's/"//g'
register: test
until: test.stdout.find('started') != -1
delay: 7
retries: 7
- name: check if grafana up
shell: docker service logs zerodefects_grafana 2>&1 | sed 's/"//g'
register: test
until: test.stdout.find('HTTP Server Listen') != -1
delay: 7
retries: 7
- name: check if nginx up
shell: docker service logs zerodefects_nginx 2>&1 | sed 's/"//g'
register: test
until: test.stdout.find('Service started') != -1
delay: 5
retries: 5
- name: subscribe orions
shell: docker run -it --rm --network showcase -v $(pwd)/subscriptions/:/opt/templates/ fiware/tool.subscribeorions --config /opt/templates/config.json
args:
chdir: /home/ubuntu/showcase/static/
register: test
failed_when:
- '"added : 4" not in test.stdout_lines'