-
Notifications
You must be signed in to change notification settings - Fork 0
/
04_add_dataservices.yaml
61 lines (51 loc) · 1.57 KB
/
04_add_dataservices.yaml
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
- hosts: dataservices
vars_files:
- vars/ansible-vars
become: yes
tasks:
- name: Enable Quobyte data service
service:
enabled: yes
state: started
name: "{{ item }}"
with_items:
- quobyte-data
- name: Wait for Dataservice RPC port to become available
wait_for:
port: 7863
- name: Wait for Dataservice metrics port to become available
wait_for:
port: 7873
- hosts: registryservices[0]
become: yes
vars_files:
- vars/ansible-vars
tasks:
- name: Wait for device inspector to find any unused devices.
pause:
seconds: 45
- name: Get Quobyte session
shell:
cmd: qmgmt -u {{ api_service }} user login {{ admin_user }} {{ admin_password }}
- name: Create a list of unformatted devices
ignore_errors: yes
shell:
cmd: qmgmt -u {{ api_service }} device list-unformatted | awk '{print $1}' | grep -v ^Handle
register: empty_devices
- debug:
var: empty_devices
- set_fact:
unformatted_devices: "{{ empty_devices.stdout_lines }}"
- debug:
var: unformatted_devices
- name: Create "make device" tasks
shell:
cmd: qmgmt -u {{ api_service }} device make {{ item }} DATA
with_items: "{{ unformatted_devices }}"
- name: Wait for tasks to finish before proceeding
shell:
cmd: qmgmt -u {{ api_service }} task list RUNNING,SCHEDULED,QUEUED -o json
register: result
until: result.stdout.find("MAKE_DEVICE") < 1
retries: 500
delay: 10