2018-06-25 19:23:20 +08:00
|
|
|
---
|
2018-07-25 22:42:30 +08:00
|
|
|
- name: "Render configuration."
|
|
|
|
become: true
|
|
|
|
template: { src: "{{ item.file }}.j2", dest: "{{ kube_config_dir }}/{{ item.file }}" }
|
|
|
|
with_items:
|
|
|
|
- { file: "glusterfs-daemonset.json" }
|
|
|
|
- { file: "heketi-bootstrap.json" }
|
|
|
|
- { file: "heketi-deployment.json" }
|
|
|
|
- { file: "heketi-service-account.json" }
|
2018-06-25 19:23:20 +08:00
|
|
|
- name: "Prepare kubernetes."
|
|
|
|
include_tasks: "kubernetes.yml"
|
|
|
|
|
|
|
|
- name: "Test heketi setup."
|
|
|
|
register: "heketi_service_state"
|
|
|
|
command: "kubectl get service heketi -o=name --ignore-not-found=true"
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
- name: "Setup heketi."
|
|
|
|
when: "heketi_service_state.stdout == \"\""
|
|
|
|
include_tasks: "setup.yml"
|
|
|
|
|
|
|
|
- name: "Test storage class."
|
|
|
|
changed_when: false
|
|
|
|
command: "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"
|
|
|
|
register: "storageclass"
|
|
|
|
- name: "Ensure storage class is up."
|
|
|
|
assert: { that: "storageclass.stdout != \"\"" }
|