2018-08-08 20:22:50 +08:00
|
|
|
---
|
|
|
|
- register: "clusterrolebinding_state"
|
2018-09-05 22:02:55 +08:00
|
|
|
command: "{{bin_dir}}/kubectl get clusterrolebinding heketi-gluster-admin -o=name --ignore-not-found=true"
|
2018-08-08 20:22:50 +08:00
|
|
|
changed_when: false
|
|
|
|
- name: "Kubernetes Apps | Deploy cluster role binding."
|
|
|
|
when: "clusterrolebinding_state.stdout == \"\""
|
2018-09-05 22:02:55 +08:00
|
|
|
command: "{{bin_dir}}/kubectl create clusterrolebinding heketi-gluster-admin --clusterrole=edit --serviceaccount=default:heketi-service-account"
|
2018-08-08 20:22:50 +08:00
|
|
|
- register: "clusterrolebinding_state"
|
2018-09-05 22:02:55 +08:00
|
|
|
command: "{{bin_dir}}/kubectl get clusterrolebinding heketi-gluster-admin -o=name --ignore-not-found=true"
|
2018-08-08 20:22:50 +08:00
|
|
|
changed_when: false
|
2019-01-10 03:01:47 +08:00
|
|
|
- assert:
|
|
|
|
that: "clusterrolebinding_state.stdout != \"\""
|
|
|
|
msg: "Cluster role binding is not present."
|
2018-08-08 20:22:50 +08:00
|
|
|
|
|
|
|
- register: "secret_state"
|
2018-09-05 22:02:55 +08:00
|
|
|
command: "{{bin_dir}}/kubectl get secret heketi-config-secret -o=name --ignore-not-found=true"
|
2018-08-08 20:22:50 +08:00
|
|
|
changed_when: false
|
|
|
|
- name: "Render Heketi secret configuration."
|
|
|
|
become: true
|
|
|
|
template:
|
|
|
|
src: "heketi.json.j2"
|
|
|
|
dest: "{{ kube_config_dir }}/heketi.json"
|
|
|
|
- name: "Deploy Heketi config secret"
|
|
|
|
when: "secret_state.stdout == \"\""
|
2018-09-05 22:02:55 +08:00
|
|
|
command: "{{bin_dir}}/kubectl create secret generic heketi-config-secret --from-file={{ kube_config_dir }}/heketi.json"
|
2018-08-08 20:22:50 +08:00
|
|
|
- register: "secret_state"
|
2018-09-05 22:02:55 +08:00
|
|
|
command: "{{bin_dir}}/kubectl get secret heketi-config-secret -o=name --ignore-not-found=true"
|
2018-08-08 20:22:50 +08:00
|
|
|
changed_when: false
|
2019-01-10 03:01:47 +08:00
|
|
|
- assert:
|
|
|
|
that: "secret_state.stdout != \"\""
|
|
|
|
msg: "Heketi config secret is not present."
|