Skip to content

Add retries to overcloud host image pulp tasks #1031

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

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 5

- 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: 5

- 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: 60

- 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: 5

- 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: 5

- 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: 5

- 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: 5

- 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: 5

- 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: 5

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