Skip to content

Commit

Permalink
test: Retry until success when installing package
Browse files Browse the repository at this point in the history
Signed-off-by: Wen Liang <[email protected]>
  • Loading branch information
liangwen12year authored and Wen Liang committed Feb 6, 2024
1 parent 1b762df commit 1214163
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
when:
- not network_packages is subset(ansible_facts.packages.keys())
register: __network_package_install
until: __network_package_install is success
retries: 6
delay: 10

- name: Install NetworkManager and nmstate when using network_state variable
package:
Expand Down
8 changes: 8 additions & 0 deletions tests/tasks/create_test_interfaces_with_dhcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
state: present
use: "{{ (__network_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
register: __install_status
# sometimes the rpm download returns a 403 - I think it is when too
# many parallel jobs attempt the download from the same controller in
# too short a period of time, so the epel server throttles additional
# downloads - use a retry here to mitigate
until: __install_status is success
retries: 6
delay: 10

- name: Install pgrep, sysctl
package:
Expand Down
4 changes: 4 additions & 0 deletions tests/tasks/manage_test_interface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
state: present
use: "{{ (__network_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
register: __install_status
until: __install_status is success
retries: 6
delay: 10

# veth
- name: Create veth interface {{ interface }}
Expand Down
4 changes: 4 additions & 0 deletions tests/tasks/setup_802_1x_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
state: present
use: "{{ (__network_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
register: __install_status
until: __install_status is success
retries: 6
delay: 10

- name: Create directory for test certificates
file:
Expand Down
4 changes: 4 additions & 0 deletions tests/tasks/setup_mock_wifi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
state: present
use: "{{ (__network_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
register: __install_status
until: __install_status is success
retries: 6
delay: 10

- name: Ensure NetworkManager is running
service:
Expand Down
4 changes: 4 additions & 0 deletions tests/tasks/setup_mock_wifi_wpa3_owe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
state: present
use: "{{ (__network_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
register: __install_status
until: __install_status is success
retries: 6
delay: 10

- name: Check if can test on CentOS and setup if possible
when: ansible_distribution == 'CentOS'
Expand Down
8 changes: 8 additions & 0 deletions tests/tasks/setup_mock_wifi_wpa3_sae.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
state: present
use: "{{ (__network_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
register: __install_status
until: __install_status is success
retries: 6
delay: 10

- name: Configure CentOS system for testing, if possible
when: ansible_distribution == 'CentOS'
Expand Down Expand Up @@ -42,6 +46,10 @@
state: present
when:
- ansible_distribution == 'Fedora'
register: __install_status
until: __install_status is success
retries: 6
delay: 10

# Since DNF package manager can not warrant installing the kernel module with
# the same version as the kernel in target machine, install the kernel module
Expand Down

0 comments on commit 1214163

Please sign in to comment.