Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(yaml): Included a task to check the volume status using mayactl #2303

Merged
merged 5 commits into from
Nov 29, 2018

Conversation

nsathyaseelan
Copy link
Contributor

Signed-off-by: sathyaseelan sathyaseelan.n@cloudbyte.com

  • Updated access mode check util to get the volume info

@yudaykiran @kmova can you please review this PR

Signed-off-by: sathyaseelan <sathyaseelan.n@cloudbyte.com>
@yudaykiran yudaykiran requested review from gprasath, ksatchit and yudaykiran and removed request for gprasath November 28, 2018 13:00
sathyaseelan added 2 commits November 28, 2018 18:35
Signed-off-by: sathyaseelan <sathyaseelan.n@cloudbyte.com>
Signed-off-by: sathyaseelan <sathyaseelan.n@cloudbyte.com>
- name: Get the replicas access mode
shell: >
source ~/.profile;
kubectl exec -it {{ mayapod.stdout }} -n openebs -- mayactl volume describe --volname "{{volname.stdout_lines[2].split()[1]}}" -n {{ ns }} | grep 'RW' | wc -l

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not use the PV name against the volname ?

delay: 30
retries: 15
changed_when: True
when: "mayactl is version('0.7.0', '>')"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -103,15 +103,15 @@
- name: 3) Replace storage-class in app yaml to use jiva based storage engine
replace:
path: "{{ result_kube_home.stdout }}/{{ percona_files.0 }}"
regexp: 'openebs-jiva-default'
regexp: 'openebs-standard'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us be sure if this is the only place needing this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. Here only we need these changes

- name: Set PV name to a variable
set_fact:
pvname: "{{pv_name.stdout.split()[10] }}"
pvname: "{{pv_name.stdout.split()[10] }}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get PV name from PVC spec itself, instead of its o/p

delay: 30
retries: 15
changed_when: True
when: "mayactl is version('0.7.0', '>')"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering describe is used in & also the check is for > 0.7.0, is there a plan to have an alternate task for =0.7.0 (in case of runs against some patches) ? Should we have another task with older mayactl/curl command for this ?

If not, do we need a version check at all ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 on using ansible version compare test/filter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ksatchit in the next task itself checking the condition for <= 0.7.0 version

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx !

sathyaseelan added 2 commits November 28, 2018 23:26
Signed-off-by: sathyaseelan <sathyaseelan.n@cloudbyte.com>
Signed-off-by: sathyaseelan <sathyaseelan.n@cloudbyte.com>
@kmova kmova merged commit f328e02 into openebs:master Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants