c12s-kubespray/contrib/network-storage/heketi/roles/provision/tasks/setup/topology.yml

19 lines
865 B
YAML
Raw Normal View History

---
- 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"
until: "heketi_topology.stdout|from_json|json_query(\"clusters[*].nodes[*].devices[?state=='online'].id\")|flatten|length == groups['heketi-node']|length"
retries: 60
delay: 5