|
|
@ -1,11 +1,11 @@ |
|
|
|
--- |
|
|
|
- name: "Get heketi volume ids." |
|
|
|
command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli volume list --json" |
|
|
|
command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli --user admin --secret {{ heketi_admin_key }} volume list --json" |
|
|
|
changed_when: false |
|
|
|
register: "heketi_volumes" |
|
|
|
- name: "Get heketi volumes." |
|
|
|
changed_when: false |
|
|
|
command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli volume info {{ volume_id }} --json" |
|
|
|
command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli --user admin --secret {{ heketi_admin_key }} 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: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli setup-openshift-heketi-storage" |
|
|
|
command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli --user admin --secret {{ heketi_admin_key }} setup-openshift-heketi-storage" |
|
|
|
when: "heketi_database_volume_exists is undefined" |
|
|
|
- name: "Copy configuration from pod." |
|
|
|
become: true |
|
|
|
command: "{{ bin_dir }}/kubectl cp {{ initial_heketi_pod_name }}:/heketi-storage.json {{ kube_config_dir }}/heketi-storage.json" |
|
|
|
- name: "Get heketi volume ids." |
|
|
|
command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli volume list --json" |
|
|
|
command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli --user admin --secret {{ heketi_admin_key }} volume list --json" |
|
|
|
changed_when: false |
|
|
|
register: "heketi_volumes" |
|
|
|
- name: "Get heketi volumes." |
|
|
|
changed_when: false |
|
|
|
command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli volume info {{ volume_id }} --json" |
|
|
|
command: "{{ bin_dir }}/kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli --user admin --secret {{ heketi_admin_key }} volume info {{ volume_id }} --json" |
|
|
|
with_items: "{{ heketi_volumes.stdout|from_json|json_query(\"volumes[*]\") }}" |
|
|
|
loop_control: { loop_var: "volume_id" } |
|
|
|
register: "volumes_information" |
|
|
|