You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.2 KiB

  1. ---
  2. - name: "Get heketi topology."
  3. register: "heketi_topology"
  4. changed_when: false
  5. command: "{{ bin_dir }}/kubectl exec {{ heketi_pod_name }} -- heketi-cli --user admin --secret {{ heketi_admin_key }} topology info --json"
  6. - name: "Render heketi topology template."
  7. become: true
  8. vars: { nodes: "{{ groups['heketi-node'] }}" }
  9. register: "rendering"
  10. template:
  11. src: "topology.json.j2"
  12. dest: "{{ kube_config_dir }}/topology.json"
  13. - name: "Copy topology configuration into container."
  14. when: "rendering.changed"
  15. command: "{{ bin_dir }}/kubectl cp {{ kube_config_dir }}/topology.json {{ heketi_pod_name }}:/tmp/topology.json"
  16. - name: "Load heketi topology."
  17. when: "rendering.changed"
  18. command: "{{ bin_dir }}/kubectl exec {{ heketi_pod_name }} -- heketi-cli --user admin --secret {{ heketi_admin_key }} topology load --json=/tmp/topology.json"
  19. - name: "Get heketi topology."
  20. register: "heketi_topology"
  21. changed_when: false
  22. command: "{{ bin_dir }}/kubectl exec {{ heketi_pod_name }} -- heketi-cli --user admin --secret {{ heketi_admin_key }} topology info --json"
  23. until: "heketi_topology.stdout|from_json|json_query(\"clusters[*].nodes[*].devices[?state=='online'].id\")|flatten|length == groups['heketi-node']|length"
  24. retries: 60
  25. delay: 5