Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
Added retries to oc debug commands while deploying storage.
Browse files Browse the repository at this point in the history
Sometimes clusters don't seem to like making so many debug pods with the
same name. This should help reduce failures.
  • Loading branch information
rmkraus committed Aug 2, 2021
1 parent 325e4f7 commit 5544fe2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/playbooks/deploy.d/container-storage/gather-facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
register: cluster_drives
ignore_errors: true
changed_when: false
retries: 10
delay: 1
until: cluster_drives is success

- name: save discovered hosts
set_stats:
Expand Down
3 changes: 3 additions & 0 deletions app/playbooks/deploy.d/container-storage/local-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
loop: "{{ stg_drives | json_query('[*].host') }}"
register: drive_id_lkp
changed_when: false
retries: 10
delay: 1
until: cluster_drives is success

- name: save storage node drive id paths
set_fact:
Expand Down
3 changes: 3 additions & 0 deletions app/playbooks/deploy.d/wipefs/gather-facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
register: cluster_drives
ignore_errors: true
changed_when: false
retries: 10
delay: 1
until: cluster_drives is success

- name: save discovered hosts
set_stats:
Expand Down
15 changes: 15 additions & 0 deletions app/playbooks/deploy.d/wipefs/wipe-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,40 @@
register: vgs
changed_when: false
ignore_errors: true
retries: 10
delay: 1
until: cluster_drives is success

- name: delete associated vgs
shell: "oc debug -n default node/{{ outer.host }} -- chroot /host vgremove --force --noudevsync '{{ item.stdout }}'"
changed_when: true
when: item.stdout != ""
loop: "{{ vgs.results }}"
retries: 10
delay: 1
until: cluster_drives is success

- name: remove pvs
shell: "oc debug -n default node/{{ outer.host }} -- chroot /host pvremove '/dev/{{ item }}'"
loop: "{{ outer.drives }}"
changed_when: true
ignore_errors: true
retries: 10
delay: 1
until: cluster_drives is success

- name: wipe filesystem
shell: "oc debug -n default node/{{ outer.host }} -- chroot /host wipefs -a '/dev/{{ item }}'"
loop: "{{ outer.drives }}"
changed_when: true
retries: 10
delay: 1
until: cluster_drives is success

- name: clear GPT and MBR structures
shell: "oc debug -n default node/{{ outer.host }} -- chroot /host sgdisk --zap-all '/dev/{{ item }}'"
loop: "{{ outer.drives }}"
changed_when: true
retries: 10
delay: 1
until: cluster_drives is success

0 comments on commit 5544fe2

Please sign in to comment.