diff --git a/contrib/network-storage/heketi/roles/provision/tasks/kubernetes.yml b/contrib/network-storage/heketi/roles/provision/tasks/kubernetes.yml index e249fc1d17168ae82672b0a714a6bd3b9e21474f..6ab92713b8534affdbdded80b3d2b4dba29921e5 100644 --- a/contrib/network-storage/heketi/roles/provision/tasks/kubernetes.yml +++ b/contrib/network-storage/heketi/roles/provision/tasks/kubernetes.yml @@ -1,16 +1,16 @@ --- - register: "daemonset_state" - command: "kubectl get daemonset glusterfs -o=name --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get daemonset glusterfs -o=name --ignore-not-found=true" changed_when: false - name: "Deploy the GlusterFS DaemonSet" when: "daemonset_state.stdout == \"\"" - command: "kubectl create -f {{ kube_config_dir }}/glusterfs-daemonset.json" + command: "{{ bin_dir }}/kubectl create -f {{ kube_config_dir }}/glusterfs-daemonset.json" - register: "daemonset_state" - command: "kubectl get daemonset glusterfs --output=json --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get daemonset glusterfs --output=json --ignore-not-found=true" changed_when: false - name: "Wait for daemonset to become available." register: "daemonset_state" - command: "kubectl get daemonset glusterfs --output=json --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get daemonset glusterfs --output=json --ignore-not-found=true" changed_when: false vars: ready: "{{ daemonset_state.stdout|from_json|json_query(\"status.numberReady\") }}" @@ -26,29 +26,29 @@ include_tasks: "kubernetes/label.yml" - register: "service_account_state" - command: "kubectl get serviceaccount heketi-service-account -o=name --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get serviceaccount heketi-service-account -o=name --ignore-not-found=true" changed_when: false - name: "Deploy the Heketi service account" when: "service_account_state.stdout == \"\"" - command: "kubectl create -f {{ kube_config_dir }}/heketi-service-account.json" + command: "{{ bin_dir }}/kubectl create -f {{ kube_config_dir }}/heketi-service-account.json" - register: "service_account_state" - command: "kubectl get serviceaccount heketi-service-account -o=name --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get serviceaccount heketi-service-account -o=name --ignore-not-found=true" changed_when: false - assert: { that: "service_account_state.stdout != \"\"", message: "Heketi service account is not present." } - register: "clusterrolebinding_state" - command: "kubectl get clusterrolebinding heketi-gluster-admin -o=name --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get clusterrolebinding heketi-gluster-admin -o=name --ignore-not-found=true" changed_when: false - name: "Deploy cluster role binding." when: "clusterrolebinding_state.stdout == \"\"" - command: "kubectl create clusterrolebinding heketi-gluster-admin --clusterrole=edit --serviceaccount=default:heketi-service-account" + command: "{{ bin_dir }}/kubectl create clusterrolebinding heketi-gluster-admin --clusterrole=edit --serviceaccount=default:heketi-service-account" - register: "clusterrolebinding_state" - command: "kubectl get clusterrolebinding heketi-gluster-admin -o=name --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get clusterrolebinding heketi-gluster-admin -o=name --ignore-not-found=true" changed_when: false - assert: { that: "clusterrolebinding_state.stdout != \"\"", message: "Cluster role binding is not present." } - register: "secret_state" - command: "kubectl get secret heketi-config-secret -o=name --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get secret heketi-config-secret -o=name --ignore-not-found=true" changed_when: false - name: "Render Heketi secret configuration." become: true @@ -57,8 +57,8 @@ dest: "{{ kube_config_dir }}/heketi.json" - name: "Deploy Heketi config secret" when: "secret_state.stdout == \"\"" - command: "kubectl create secret generic heketi-config-secret --from-file={{ kube_config_dir }}/heketi.json" + command: "{{ bin_dir }}/kubectl create secret generic heketi-config-secret --from-file={{ kube_config_dir }}/heketi.json" - register: "secret_state" - command: "kubectl get secret heketi-config-secret -o=name --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get secret heketi-config-secret -o=name --ignore-not-found=true" changed_when: false - assert: { that: "secret_state.stdout != \"\"", message: "Heketi config secret is not present." } diff --git a/contrib/network-storage/heketi/roles/provision/tasks/kubernetes/label.yml b/contrib/network-storage/heketi/roles/provision/tasks/kubernetes/label.yml index 7ff9ee4ae63ef9e62d1486ea0e877b742ee5992a..61729a5e29b207aeec550c143b03b4d4930dc049 100644 --- a/contrib/network-storage/heketi/roles/provision/tasks/kubernetes/label.yml +++ b/contrib/network-storage/heketi/roles/provision/tasks/kubernetes/label.yml @@ -1,11 +1,11 @@ --- - register: "label_present" - command: "kubectl get node --selector=storagenode=glusterfs,kubernetes.io/hostname={{ node }} --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get node --selector=storagenode=glusterfs,kubernetes.io/hostname={{ node }} --ignore-not-found=true" changed_when: false - name: "Assign storage label" when: "label_present.stdout_lines|length == 0" - command: "kubectl label node {{ node }} storagenode=glusterfs" + command: "{{ bin_dir }}/kubectl label node {{ node }} storagenode=glusterfs" - register: "label_present" - command: "kubectl get node --selector=storagenode=glusterfs,kubernetes.io/hostname={{ node }} --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get node --selector=storagenode=glusterfs,kubernetes.io/hostname={{ node }} --ignore-not-found=true" changed_when: false - assert: { that: "label_present|length > 0", msg: "Node {{ node }} has not been assigned with label storagenode=glusterfs." } diff --git a/contrib/network-storage/heketi/roles/provision/tasks/main.yml b/contrib/network-storage/heketi/roles/provision/tasks/main.yml index f85306b476be8afa759e945d5e6d8388b5b90039..c247929a7987aa4dc5d58245db7f4d8a1c25fac0 100644 --- a/contrib/network-storage/heketi/roles/provision/tasks/main.yml +++ b/contrib/network-storage/heketi/roles/provision/tasks/main.yml @@ -12,7 +12,7 @@ - name: "Test heketi setup." register: "heketi_service_state" - command: "kubectl get service heketi -o=name --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get service heketi -o=name --ignore-not-found=true" changed_when: false - name: "Setup heketi." @@ -21,14 +21,14 @@ - name: "Test storage class." changed_when: false - command: "kubectl get storageclass gluster --ignore-not-found=true --output=json" + command: "{{ bin_dir }}/kubectl get storageclass gluster --ignore-not-found=true --output=json" register: "storageclass" - name: "Setup storage class." when: "storageclass.stdout == \"\"" include_tasks: "storageclass.yml" - name: "Test storage class." changed_when: false - command: "kubectl get storageclass gluster --ignore-not-found=true --output=json" + command: "{{ bin_dir }}/kubectl get storageclass gluster --ignore-not-found=true --output=json" register: "storageclass" - name: "Ensure storage class is up." assert: { that: "storageclass.stdout != \"\"" } diff --git a/contrib/network-storage/heketi/roles/provision/tasks/setup.yml b/contrib/network-storage/heketi/roles/provision/tasks/setup.yml index a2c532fa04ffa5e3a9d28aab22b3b8c25259ea01..96462dd11e3a39c541b43ee097b5eceb15401ac6 100644 --- a/contrib/network-storage/heketi/roles/provision/tasks/setup.yml +++ b/contrib/network-storage/heketi/roles/provision/tasks/setup.yml @@ -3,7 +3,7 @@ - name: "Get state of heketi service, deployment and pods." register: "initial_heketi_state" changed_when: false - command: "kubectl get services,deployments,pods --selector=deploy-heketi --output=json" + command: "{{ bin_dir }}/kubectl get services,deployments,pods --selector=deploy-heketi --output=json" - name: "Bootstrap heketi." when: - "(initial_heketi_state.stdout|from_json|json_query(\"items[?kind=='Service']\"))|length == 0" @@ -14,7 +14,7 @@ # Prepare heketi topology - name: "Get heketi initial pod state." register: "initial_heketi_pod" - command: "kubectl get pods --selector=deploy-heketi=pod,glusterfs=heketi-pod,name=deploy-heketi --output=json" + command: "{{ bin_dir }}/kubectl get pods --selector=deploy-heketi=pod,glusterfs=heketi-pod,name=deploy-heketi --output=json" changed_when: false - name: "Ensure heketi bootstrap pod is up." assert: @@ -24,7 +24,7 @@ - name: "Test heketi topology." changed_when: false register: "heketi_topology" - command: "kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli topology info --json" + command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli topology info --json" - name: "Load heketi topology." when: "heketi_topology.stdout|from_json|json_query(\"clusters[*].nodes[*]\")|flatten|length == 0" include_tasks: "setup/topology.yml" @@ -35,10 +35,10 @@ # Prepare heketi storage - name: "Test heketi storage." - command: "kubectl get secrets,endpoints,services,jobs --output=json" + command: "{{ bin_dir }}/kubectl get secrets,endpoints,services,jobs --output=json" changed_when: false register: "heketi_storage_state" -- command: "kubectl get secrets,endpoints,services,jobs --output=json" +- command: "{{ bin_dir }}/kubectl get secrets,endpoints,services,jobs --output=json" register: "job" - name: "Create heketi storage." include_tasks: "setup/storage.yml" diff --git a/contrib/network-storage/heketi/roles/provision/tasks/setup/boot.yml b/contrib/network-storage/heketi/roles/provision/tasks/setup/boot.yml index 6aab82cca4e8bfb303432d24af7e63ffdb495683..806e9157071ef147a1b18670fae33aa09db299e5 100644 --- a/contrib/network-storage/heketi/roles/provision/tasks/setup/boot.yml +++ b/contrib/network-storage/heketi/roles/provision/tasks/setup/boot.yml @@ -2,9 +2,9 @@ - name: "Get state of heketi service, deployment and pods." register: "initial_heketi_state" changed_when: false - command: "kubectl get services,deployments,pods --selector=deploy-heketi --output=json" + command: "{{ bin_dir }}/kubectl get services,deployments,pods --selector=deploy-heketi --output=json" - name: "Create Heketi initial service and deployment" - command: "kubectl create -f {{ kube_config_dir }}/heketi-bootstrap.json" + command: "{{ bin_dir }}/kubectl create -f {{ kube_config_dir }}/heketi-bootstrap.json" when: - "(initial_heketi_state.stdout|from_json|json_query(\"items[?kind=='Service']\"))|length == 0" - "(initial_heketi_state.stdout|from_json|json_query(\"items[?kind=='Deployment']\"))|length == 0" @@ -12,14 +12,14 @@ - name: "Get state of heketi service, deployment and pods." register: "initial_heketi_state" changed_when: false - command: "kubectl get services,deployments,pods --selector=deploy-heketi --output=json" + command: "{{ bin_dir }}/kubectl get services,deployments,pods --selector=deploy-heketi --output=json" - name: "Wait for heketi bootstrap to complete." changed_when: false register: "initial_heketi_state" vars: 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: "kubectl get services,deployments,pods --selector=deploy-heketi --output=json" + command: "{{ bin_dir }}/kubectl get services,deployments,pods --selector=deploy-heketi --output=json" until: - "initial_heketi_state.stdout|from_json|json_query(pods_query) == 'True'" - "initial_heketi_state.stdout|from_json|json_query(deployments_query) == 'True'" diff --git a/contrib/network-storage/heketi/roles/provision/tasks/setup/heketi.yml b/contrib/network-storage/heketi/roles/provision/tasks/setup/heketi.yml index cba5e57ed9542b8d74079f8a8f9a91b6947109de..c38b151ac464eae1623a9cdc57f4bf83d118e877 100644 --- a/contrib/network-storage/heketi/roles/provision/tasks/setup/heketi.yml +++ b/contrib/network-storage/heketi/roles/provision/tasks/setup/heketi.yml @@ -1,9 +1,9 @@ --- - name: "Create long term Heketi instance." - command: "kubectl create -f {{ kube_config_dir }}/heketi-deployment.json" + command: "{{ bin_dir }}/kubectl create -f {{ kube_config_dir }}/heketi-deployment.json" - name: "Get heketi deployment state." register: "heketi_deployment_state" - command: "kubectl get deployment heketi -o=name --ignore-not-found=true" + command: "{{ bin_dir }}/kubectl get deployment heketi -o=name --ignore-not-found=true" changed_when: false - name: "Ensure heketi is up and running." assert: { that: "heketi_deployment_state.stdout != \"\"", message: "Heketi deployment did not succeed." } diff --git a/contrib/network-storage/heketi/roles/provision/tasks/setup/storage.yml b/contrib/network-storage/heketi/roles/provision/tasks/setup/storage.yml index 1c471db3b08ace6008808fd7cd4d4896ae0074cb..7c49a225815c366e78299119cb9c66d051868cbf 100644 --- a/contrib/network-storage/heketi/roles/provision/tasks/setup/storage.yml +++ b/contrib/network-storage/heketi/roles/provision/tasks/setup/storage.yml @@ -1,10 +1,10 @@ --- - name: "Test heketi storage." - command: "kubectl get secrets,endpoints,services,jobs --output=json" + command: "{{ bin_dir }}/kubectl get secrets,endpoints,services,jobs --output=json" changed_when: false register: "heketi_storage_state" - name: "Create heketi storage." - command: "kubectl create -f {{ kube_config_dir }}/heketi-storage.json" + command: "{{ bin_dir }}/kubectl create -f {{ kube_config_dir }}/heketi-storage.json" vars: secret_query: "items[?metadata.name=='heketi-storage-secret' && kind=='Secret']" endpoints_query: "items[?metadata.name=='heketi-storage-endpoints' && kind=='Endpoints']" @@ -16,10 +16,10 @@ - "heketi_storage_state.stdout|from_json|json_query(service_query)|length == 0" - "heketi_storage_state.stdout|from_json|json_query(job_query)|length == 0" register: "heketi_storage_result" -- command: "kubectl get secrets,endpoints,services,jobs --output=json" +- command: "{{ bin_dir }}/kubectl get secrets,endpoints,services,jobs --output=json" register: "heketi_storage_state" - name: "Get state of heketi storage service, endpoint, secret and job." - command: "kubectl get secrets,endpoints,services,jobs --output=json" + command: "{{ bin_dir }}/kubectl get secrets,endpoints,services,jobs --output=json" changed_when: false register: "heketi_storage_state" vars: diff --git a/contrib/network-storage/heketi/roles/provision/tasks/setup/tear-down-bootstrap.yml b/contrib/network-storage/heketi/roles/provision/tasks/setup/tear-down-bootstrap.yml index 0fa3a19479f600ed10d4395ff7be1f4b2d576807..0ffd6f469f2e5fbbcbef40fe45e0aa8dc7577144 100644 --- a/contrib/network-storage/heketi/roles/provision/tasks/setup/tear-down-bootstrap.yml +++ b/contrib/network-storage/heketi/roles/provision/tasks/setup/tear-down-bootstrap.yml @@ -1,13 +1,13 @@ --- - name: "Get existing Heketi deploy resources." - command: "kubectl get all --selector=\"deploy-heketi\" -o=json" + command: "{{ bin_dir }}/kubectl get all --selector=\"deploy-heketi\" -o=json" register: "heketi_resources" changed_when: false - name: "Delete bootstrap Heketi." - command: "kubectl delete all,service,jobs,deployment,secret --selector=\"deploy-heketi\"" + command: "{{ bin_dir }}/kubectl delete all,service,jobs,deployment,secret --selector=\"deploy-heketi\"" when: "heketi_resources.stdout|from_json|json_query('items[*]')|length > 0" - name: "Ensure there is nothing left over." - command: "kubectl get all,service,jobs,deployment,secret --selector=\"deploy-heketi\" -o=json" + command: "{{ bin_dir }}/kubectl get all,service,jobs,deployment,secret --selector=\"deploy-heketi\" -o=json" register: "heketi_result" until: "heketi_result.stdout|from_json|json_query('items[*]')|length == 0" retries: 60 diff --git a/contrib/network-storage/heketi/roles/provision/tasks/setup/topology.yml b/contrib/network-storage/heketi/roles/provision/tasks/setup/topology.yml index 190a131c34eeb653ebcfb35890bf2914dd232382..fd148d8d915310945ec696e21db655a5d884245e 100644 --- a/contrib/network-storage/heketi/roles/provision/tasks/setup/topology.yml +++ b/contrib/network-storage/heketi/roles/provision/tasks/setup/topology.yml @@ -1,7 +1,7 @@ --- - name: "Get heketi topology." register: "heketi_topology" - command: "kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli topology info --json" + command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli topology info --json" - name: "Render heketi topology template." become: true vars: { nodes: "{{ groups['heketi-node'] }}" } @@ -9,13 +9,13 @@ src: "topology.json.j2" dest: "{{ kube_config_dir }}/topology.json" - name: "Copy topology configuration into container." - command: "kubectl cp {{ kube_config_dir }}/topology.json {{ initial_heketi_pod_name }}:/tmp/topology.json" + command: "{{ bin_dir }}/kubectl cp {{ kube_config_dir }}/topology.json {{ initial_heketi_pod_name }}:/tmp/topology.json" - name: "Load heketi topology." when: "heketi_topology.stdout|from_json|json_query(\"clusters[*].nodes[*]\")|flatten|length == 0" - command: "kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli topology load --json=/tmp/topology.json" + command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli topology load --json=/tmp/topology.json" - name: "Get heketi topology." register: "heketi_topology" - command: "kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli topology info --json" + command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli 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 diff --git a/contrib/network-storage/heketi/roles/provision/tasks/setup/volumes.yml b/contrib/network-storage/heketi/roles/provision/tasks/setup/volumes.yml index d8e7bf4b85e3d0220053ec760848b42d5c94fa72..0d24a3a0b9c6713b1781881bc0ea697c9879be43 100644 --- a/contrib/network-storage/heketi/roles/provision/tasks/setup/volumes.yml +++ b/contrib/network-storage/heketi/roles/provision/tasks/setup/volumes.yml @@ -1,11 +1,11 @@ --- - name: "Get heketi volume ids." - command: "kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli volume list --json" + command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli volume list --json" changed_when: false register: "heketi_volumes" - name: "Get heketi volumes." changed_when: false - command: "kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli volume info {{ volume_id }} --json" + command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli volume info {{ volume_id }} --json" with_items: "{{ heketi_volumes.stdout|from_json|json_query(\"volumes[*]\") }}" loop_control: { loop_var: "volume_id" } register: "volumes_information" @@ -16,18 +16,18 @@ vars: { volume: "{{ volume_information.stdout|from_json }}" } when: "volume.name == 'heketidbstorage'" - name: "Provision database volume." - command: "kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli setup-openshift-heketi-storage" + command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli setup-openshift-heketi-storage" when: "heketi_database_volume_exists is undefined" - name: "Copy configuration from pod." become: true - command: "/usr/local/bin/kubectl cp {{ initial_heketi_pod_name }}:/heketi-storage.json {{ kube_config_dir }}/heketi-storage.json" + command: "{{ bin_dir }}/kubectl cp {{ initial_heketi_pod_name }}:/heketi-storage.json {{ kube_config_dir }}/heketi-storage.json" - name: "Get heketi volume ids." - command: "kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli volume list --json" + command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli volume list --json" changed_when: false register: "heketi_volumes" - name: "Get heketi volumes." changed_when: false - command: "kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli volume info {{ volume_id }} --json" + command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli volume info {{ volume_id }} --json" with_items: "{{ heketi_volumes.stdout|from_json|json_query(\"volumes[*]\") }}" loop_control: { loop_var: "volume_id" } register: "volumes_information" diff --git a/contrib/network-storage/heketi/roles/provision/tasks/storageclass.yml b/contrib/network-storage/heketi/roles/provision/tasks/storageclass.yml index 761ec6533a1d6c32d07683d728ee7b8bd97293b9..393d76e64679f243b055f60e884ef756c0df3443 100644 --- a/contrib/network-storage/heketi/roles/provision/tasks/storageclass.yml +++ b/contrib/network-storage/heketi/roles/provision/tasks/storageclass.yml @@ -1,10 +1,10 @@ --- - name: "Test storage class." - command: "kubectl get storageclass gluster --ignore-not-found=true --output=json" + command: "{{ bin_dir }}/kubectl get storageclass gluster --ignore-not-found=true --output=json" register: "storageclass" changed_when: false - name: "Test heketi service." - command: "kubectl get service heketi --ignore-not-found=true --output=json" + command: "{{ bin_dir }}/kubectl get service heketi --ignore-not-found=true --output=json" register: "heketi_service" changed_when: false - name: "Ensure heketi service is available." @@ -18,4 +18,4 @@ dest: "{{ kube_config_dir }}/storageclass.yml" - name: "Setup storage class." when: "storageclass.stdout == \"\"" - command: "kubectl create -f {{ kube_config_dir }}/storageclass.yml" + command: "{{ bin_dir }}/kubectl create -f {{ kube_config_dir }}/storageclass.yml" diff --git a/contrib/network-storage/heketi/roles/tear-down/tasks/main.yml b/contrib/network-storage/heketi/roles/tear-down/tasks/main.yml index 3943047ec76dbcab2a102810ec2d1a5890c7f92a..3c9659baee4c5fbcb34b81ad614344a5a069cbab 100644 --- a/contrib/network-storage/heketi/roles/tear-down/tasks/main.yml +++ b/contrib/network-storage/heketi/roles/tear-down/tasks/main.yml @@ -1,52 +1,52 @@ --- - name: "Remove storage class." - command: "kubectl delete storageclass gluster" + command: "{{ bin_dir }}/kubectl delete storageclass gluster" ignore_errors: true - name: "Tear down heketi." - command: "kubectl delete all,service,jobs,deployment,secret --selector=\"glusterfs=heketi-pod\"" + command: "{{ bin_dir }}/kubectl delete all,service,jobs,deployment,secret --selector=\"glusterfs=heketi-pod\"" ignore_errors: true - name: "Tear down heketi." - command: "kubectl delete all,service,jobs,deployment,secret --selector=\"glusterfs=heketi-deployment\"" + command: "{{ bin_dir }}/kubectl delete all,service,jobs,deployment,secret --selector=\"glusterfs=heketi-deployment\"" ignore_errors: true - name: "Tear down bootstrap." include_tasks: "../provision/tasks/setup/tear-down-bootstrap.yml" - name: "Ensure there is nothing left over." - command: "kubectl get all,service,jobs,deployment,secret --selector=\"glusterfs=heketi-pod\" -o=json" + command: "{{ bin_dir }}/kubectl get all,service,jobs,deployment,secret --selector=\"glusterfs=heketi-pod\" -o=json" register: "heketi_result" until: "heketi_result.stdout|from_json|json_query('items[*]')|length == 0" retries: 60 delay: 5 - name: "Ensure there is nothing left over." - command: "kubectl get all,service,jobs,deployment,secret --selector=\"glusterfs=heketi-deployment\" -o=json" + command: "{{ bin_dir }}/kubectl get all,service,jobs,deployment,secret --selector=\"glusterfs=heketi-deployment\" -o=json" register: "heketi_result" until: "heketi_result.stdout|from_json|json_query('items[*]')|length == 0" retries: 60 delay: 5 - name: "Tear down glusterfs." - command: "kubectl delete daemonset.extensions/glusterfs" + command: "{{ bin_dir }}/kubectl delete daemonset.extensions/glusterfs" ignore_errors: true - name: "Remove heketi storage service." - command: "kubectl delete service heketi-storage-endpoints" + command: "{{ bin_dir }}/kubectl delete service heketi-storage-endpoints" ignore_errors: true - name: "Remove heketi gluster role binding" - command: "kubectl delete clusterrolebinding heketi-gluster-admin" + command: "{{ bin_dir }}/kubectl delete clusterrolebinding heketi-gluster-admin" ignore_errors: true - name: "Remove heketi config secret" - command: "kubectl delete secret heketi-config-secret" + command: "{{ bin_dir }}/kubectl delete secret heketi-config-secret" ignore_errors: true - name: "Remove heketi db backup" - command: "kubectl delete secret heketi-db-backup" + command: "{{ bin_dir }}/kubectl delete secret heketi-db-backup" ignore_errors: true - name: "Remove heketi service account" - command: "kubectl delete serviceaccount heketi-service-account" + command: "{{ bin_dir }}/kubectl delete serviceaccount heketi-service-account" ignore_errors: true - name: "Get secrets" - command: "kubectl get secrets --output=\"json\"" + command: "{{ bin_dir }}/kubectl get secrets --output=\"json\"" register: "secrets" changed_when: false - name: "Remove heketi storage secret" vars: { storage_query: "items[?metadata.annotations.\"kubernetes.io/service-account.name\"=='heketi-service-account'].metadata.name|[0]" } - command: "kubectl delete secret {{ secrets.stdout|from_json|json_query(storage_query) }}" + command: "{{ bin_dir }}/kubectl delete secret {{ secrets.stdout|from_json|json_query(storage_query) }}" when: "storage_query is defined" ignore_errors: true - name: "Prepare cluster disks."