Skip to content

Commit

Permalink
Add retries to overcloud host image pulp tasks
Browse files Browse the repository at this point in the history
Retries have been added to the stackhpc.pulp collection to improve
reliability. Adding the same here.
  • Loading branch information
markgoddard committed Nov 16, 2023
1 parent 920f01d commit 6c8460b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions etc/kayobe/ansible/pulp-host-image-promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
name: "{{ repository_name }}_{{ promotion_tag }}"
base_path: "{{ base_path }}/{{ promotion_tag }}"
register: distribution_details
until: distribution_details is success
retries: 3
delay: 1

- name: Fail if the image does not exist
fail:
Expand All @@ -34,6 +37,10 @@
base_path: "{{ base_path }}/{{ promotion_tag }}"
content_guard: release
state: present
register: content_guard_result
until: content_guard_result is success
retries: 3
delay: 1

- name: Print version tag and os
debug:
Expand Down
26 changes: 26 additions & 0 deletions etc/kayobe/ansible/pulp-host-image-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
password: "{{ remote_pulp_password }}"
file: "{{ found_files.files[0].path }}"
state: present
register: upload_result
until: upload_result is success
retries: 3
delay: 1

- name: Get sha256 hash
ansible.builtin.stat:
Expand All @@ -40,6 +44,10 @@
sha256: "{{ file_stats.stat.checksum }}"
relative_path: "{{ found_files.files[0].path | basename }}"
state: present
register: file_content_result
until: file_content_result is success
retries: 3
delay: 1

- name: Ensure file repo exists
pulp.squeezer.file_repository:
Expand All @@ -48,6 +56,10 @@
password: "{{ remote_pulp_password }}"
name: "{{ repository_name }}"
state: present
register: file_repo_result
until: file_repo_result is success
retries: 3
delay: 1

- name: Add content to file repo
pulp.squeezer.file_repository_content:
Expand All @@ -58,6 +70,10 @@
present_content:
- relative_path: "{{ found_files.files[0].path | basename }}"
sha256: "{{ file_stats.stat.checksum }}"
register: file_repo_content_result
until: file_repo_content_result is success
retries: 3
delay: 1

- name: Create a new publication to point to this version
pulp.squeezer.file_publication:
Expand All @@ -67,6 +83,9 @@
repository: "{{ repository_name }}"
state: present
register: publication_details
until: publication_details is success
retries: 3
delay: 1

- name: Update distribution for latest version
pulp.squeezer.file_distribution:
Expand All @@ -79,6 +98,9 @@
content_guard: development
state: present
register: latest_distribution_details
until: latest_distribution_details is success
retries: 3
delay: 1

- name: Create distribution for given version
pulp.squeezer.file_distribution:
Expand All @@ -91,6 +113,10 @@
content_guard: development
state: present
when: latest_distribution_details.changed
register: distribution_result
until: distribution_result is success
retries: 3
delay: 1

- name: Update new images file with versioned path
lineinfile:
Expand Down

0 comments on commit 6c8460b

Please sign in to comment.