2018-06-25 11:23:20 +00:00
|
|
|
---
|
|
|
|
- name: "Get heketi topology."
|
|
|
|
register: "heketi_topology"
|
|
|
|
command: "heketi-cli -s http://localhost:48080 topology info --json"
|
|
|
|
- name: "Render heketi topology template."
|
|
|
|
vars: { nodes: "{{ groups['heketi-node'] }}" }
|
|
|
|
template:
|
|
|
|
src: "topology.json.j2"
|
|
|
|
dest: "{{ artifacts_dir }}/topology.json"
|
|
|
|
- name: "Load heketi topology."
|
|
|
|
when: "heketi_topology.stdout|from_json|json_query(\"clusters[*].nodes[*]\")|flatten|length == 0"
|
|
|
|
command: "heketi-cli -s http://localhost:48080 topology load --json={{ artifacts_dir }}/topology.json"
|
|
|
|
- name: "Get heketi topology."
|
|
|
|
register: "heketi_topology"
|
|
|
|
command: "heketi-cli -s http://localhost:48080 topology info --json"
|
2018-07-05 00:14:36 +00:00
|
|
|
until: "heketi_topology.stdout|from_json|json_query(\"clusters[*].nodes[*].devices[?state=='online'].id\")|flatten|length == groups['heketi-node']|length"
|
|
|
|
retries: 60
|
|
|
|
delay: 5
|