Skip to content

Commit a8fb2c8

Browse files
authored
Merge pull request #1031 from stackhpc/yoga-host-image-retries
Add retries to overcloud host image pulp tasks
2 parents ee07cd3 + c2bd71b commit a8fb2c8

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

etc/kayobe/ansible/pulp-host-image-promote.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
name: "{{ repository_name }}_{{ promotion_tag }}"
2020
base_path: "{{ base_path }}/{{ promotion_tag }}"
2121
register: distribution_details
22+
until: distribution_details is success
23+
retries: 3
24+
delay: 5
2225

2326
- name: Fail if the image does not exist
2427
fail:
@@ -34,6 +37,10 @@
3437
base_path: "{{ base_path }}/{{ promotion_tag }}"
3538
content_guard: release
3639
state: present
40+
register: content_guard_result
41+
until: content_guard_result is success
42+
retries: 3
43+
delay: 5
3744

3845
- name: Print version tag and os
3946
debug:

etc/kayobe/ansible/pulp-host-image-upload.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
password: "{{ remote_pulp_password }}"
2626
file: "{{ found_files.files[0].path }}"
2727
state: present
28+
register: upload_result
29+
until: upload_result is success
30+
retries: 3
31+
delay: 60
2832

2933
- name: Get sha256 hash
3034
ansible.builtin.stat:
@@ -40,6 +44,10 @@
4044
sha256: "{{ file_stats.stat.checksum }}"
4145
relative_path: "{{ found_files.files[0].path | basename }}"
4246
state: present
47+
register: file_content_result
48+
until: file_content_result is success
49+
retries: 3
50+
delay: 5
4351

4452
- name: Ensure file repo exists
4553
pulp.squeezer.file_repository:
@@ -48,6 +56,10 @@
4856
password: "{{ remote_pulp_password }}"
4957
name: "{{ repository_name }}"
5058
state: present
59+
register: file_repo_result
60+
until: file_repo_result is success
61+
retries: 3
62+
delay: 5
5163

5264
- name: Add content to file repo
5365
pulp.squeezer.file_repository_content:
@@ -58,6 +70,10 @@
5870
present_content:
5971
- relative_path: "{{ found_files.files[0].path | basename }}"
6072
sha256: "{{ file_stats.stat.checksum }}"
73+
register: file_repo_content_result
74+
until: file_repo_content_result is success
75+
retries: 3
76+
delay: 5
6177

6278
- name: Create a new publication to point to this version
6379
pulp.squeezer.file_publication:
@@ -67,6 +83,9 @@
6783
repository: "{{ repository_name }}"
6884
state: present
6985
register: publication_details
86+
until: publication_details is success
87+
retries: 3
88+
delay: 5
7089

7190
- name: Update distribution for latest version
7291
pulp.squeezer.file_distribution:
@@ -79,6 +98,9 @@
7998
content_guard: development
8099
state: present
81100
register: latest_distribution_details
101+
until: latest_distribution_details is success
102+
retries: 3
103+
delay: 5
82104

83105
- name: Create distribution for given version
84106
pulp.squeezer.file_distribution:
@@ -91,6 +113,10 @@
91113
content_guard: development
92114
state: present
93115
when: latest_distribution_details.changed
116+
register: distribution_result
117+
until: distribution_result is success
118+
retries: 3
119+
delay: 5
94120

95121
- name: Update new images file with versioned path
96122
lineinfile:

0 commit comments

Comments
 (0)