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.

38 lines
1.6 KiB

  1. ---
  2. - name: "Kubernetes Apps | Lay Down GlusterFS Daemonset"
  3. template: { src: "glusterfs-daemonset.json.j2", dest: "{{ kube_config_dir }}/glusterfs-daemonset.json" }
  4. become: true
  5. register: "rendering"
  6. - name: "Kubernetes Apps | Install and configure GlusterFS daemonset"
  7. kube:
  8. name: "GlusterFS"
  9. kubectl: "{{ bin_dir }}/kubectl"
  10. filename: "{{ kube_config_dir }}/glusterfs-daemonset.json"
  11. state: "{{ rendering.changed | ternary('latest', 'present') }}"
  12. - name: "Kubernetes Apps | Label GlusterFS nodes"
  13. include_tasks: "glusterfs/label.yml"
  14. with_items: "{{ groups['heketi-node'] }}"
  15. loop_control:
  16. loop_var: "node"
  17. - name: "Kubernetes Apps | Wait for daemonset to become available."
  18. register: "daemonset_state"
  19. command: "{{ bin_dir }}/kubectl get daemonset glusterfs --output=json --ignore-not-found=true"
  20. changed_when: false
  21. vars:
  22. daemonset_state: { stdout: "{}" }
  23. ready: "{{ daemonset_state.stdout|from_json|json_query(\"status.numberReady\") }}"
  24. desired: "{{ daemonset_state.stdout|from_json|json_query(\"status.desiredNumberScheduled\") }}"
  25. until: "ready | int >= 3"
  26. retries: 60
  27. delay: 5
  28. - name: "Kubernetes Apps | Lay Down Heketi Service Account"
  29. template: { src: "heketi-service-account.json.j2", dest: "{{ kube_config_dir }}/heketi-service-account.json" }
  30. become: true
  31. register: "rendering"
  32. - name: "Kubernetes Apps | Install and configure Heketi Service Account"
  33. kube:
  34. name: "GlusterFS"
  35. kubectl: "{{ bin_dir }}/kubectl"
  36. filename: "{{ kube_config_dir }}/heketi-service-account.json"
  37. state: "{{ rendering.changed | ternary('latest', 'present') }}"