2018-08-08 12:22:50 +00:00
|
|
|
---
|
|
|
|
- name: "Kubernetes Apps | Lay Down Heketi"
|
|
|
|
become: true
|
2019-05-16 07:27:43 +00:00
|
|
|
template:
|
|
|
|
src: "heketi-deployment.json.j2"
|
|
|
|
dest: "{{ kube_config_dir }}/heketi-deployment.json"
|
2021-07-12 07:00:47 +00:00
|
|
|
mode: 0644
|
2018-08-08 12:22:50 +00:00
|
|
|
register: "rendering"
|
2019-05-16 07:27:43 +00:00
|
|
|
|
2018-08-08 12:22:50 +00:00
|
|
|
- name: "Kubernetes Apps | Install and configure Heketi"
|
|
|
|
kube:
|
|
|
|
name: "GlusterFS"
|
2019-05-02 21:24:21 +00:00
|
|
|
kubectl: "{{ bin_dir }}/kubectl"
|
2018-08-08 12:22:50 +00:00
|
|
|
filename: "{{ kube_config_dir }}/heketi-deployment.json"
|
|
|
|
state: "{{ rendering.changed | ternary('latest', 'present') }}"
|
2019-05-16 07:27:43 +00:00
|
|
|
|
2018-08-08 12:22:50 +00:00
|
|
|
- name: "Ensure heketi is up and running."
|
|
|
|
changed_when: false
|
|
|
|
register: "heketi_state"
|
|
|
|
vars:
|
2019-05-16 07:27:43 +00:00
|
|
|
heketi_state:
|
|
|
|
stdout: "{}"
|
2018-08-08 12:22:50 +00:00
|
|
|
pods_query: "items[?kind=='Pod'].status.conditions|[0][?type=='Ready'].status|[0]"
|
|
|
|
deployments_query: "items[?kind=='Deployment'].status.conditions|[0][?type=='Available'].status|[0]"
|
|
|
|
command: "{{ bin_dir }}/kubectl get deployments,pods --selector=glusterfs --output=json"
|
|
|
|
until:
|
2019-04-01 09:38:33 +00:00
|
|
|
- "heketi_state.stdout|from_json|json_query(pods_query) == 'True'"
|
|
|
|
- "heketi_state.stdout|from_json|json_query(deployments_query) == 'True'"
|
2018-08-08 12:22:50 +00:00
|
|
|
retries: 60
|
|
|
|
delay: 5
|
2019-05-16 07:27:43 +00:00
|
|
|
|
|
|
|
- name: Set the Heketi pod name
|
|
|
|
set_fact:
|
2018-08-08 12:22:50 +00:00
|
|
|
heketi_pod_name: "{{ heketi_state.stdout|from_json|json_query(\"items[?kind=='Pod'].metadata.name|[0]\") }}"
|