--- - 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" - set_fact: { heketi_volumes: "{{ heketi_topology.stdout|from_json|json_query(\"clusters[*].volumes[?name=='heketidbstorage']\") }}" } - name: "Ensure heketi nodes are configured." assert: that: "heketi_topology.stdout|from_json|json_query(\"clusters[*].nodes[*]\")|flatten|length > 0" msg: "Heketi topology missing."