use bin_dir variable

This commit is contained in:
Sascha Marcel Schmidt 2018-09-05 16:02:55 +02:00
parent ce776f0f6a
commit 64b0ce974d
No known key found for this signature in database
GPG key ID: D1D6CE184437796D
3 changed files with 8 additions and 7 deletions

View file

@ -7,7 +7,7 @@
- name: "Kubernetes Apps | Test Heketi" - name: "Kubernetes Apps | Test Heketi"
register: "heketi_service_state" register: "heketi_service_state"
command: "kubectl get service heketi-storage-endpoints -o=name --ignore-not-found=true" command: "{{bin_dir}}/kubectl get service heketi-storage-endpoints -o=name --ignore-not-found=true"
changed_when: false changed_when: false
- name: "Kubernetes Apps | Bootstrap Heketi" - name: "Kubernetes Apps | Bootstrap Heketi"

View file

@ -1,17 +1,17 @@
--- ---
- register: "clusterrolebinding_state" - 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 changed_when: false
- name: "Kubernetes Apps | Deploy cluster role binding." - name: "Kubernetes Apps | Deploy cluster role binding."
when: "clusterrolebinding_state.stdout == \"\"" 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" - 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 changed_when: false
- assert: { that: "clusterrolebinding_state.stdout != \"\"", message: "Cluster role binding is not present." } - assert: { that: "clusterrolebinding_state.stdout != \"\"", message: "Cluster role binding is not present." }
- register: "secret_state" - 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 changed_when: false
- name: "Render Heketi secret configuration." - name: "Render Heketi secret configuration."
become: true become: true
@ -20,8 +20,8 @@
dest: "{{ kube_config_dir }}/heketi.json" dest: "{{ kube_config_dir }}/heketi.json"
- name: "Deploy Heketi config secret" - name: "Deploy Heketi config secret"
when: "secret_state.stdout == \"\"" 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" - 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 changed_when: false
- assert: { that: "secret_state.stdout != \"\"", message: "Heketi config secret is not present." } - assert: { that: "secret_state.stdout != \"\"", message: "Heketi config secret is not present." }

View file

@ -20,5 +20,6 @@
- name: "Kubernetes Apps | Install and configure Storace Class" - name: "Kubernetes Apps | Install and configure Storace Class"
kube: kube:
name: "GlusterFS" name: "GlusterFS"
kubectl: "{{bin_dir}}/kubectl"
filename: "{{ kube_config_dir }}/storageclass.yml" filename: "{{ kube_config_dir }}/storageclass.yml"
state: "{{ rendering.changed | ternary('latest', 'present') }}" state: "{{ rendering.changed | ternary('latest', 'present') }}"