mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
test: Retry until success when installing package
Sometimes the rpm download returns a 403, which is likely caused by 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. Signed-off-by: Wen Liang <liangwen12year@gmail.com>
This commit is contained in:
parent
910ddd20a9
commit
ae9f212086
8 changed files with 45 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@
|
|||
import_tasks: tasks/assert_device_present.yml
|
||||
vars:
|
||||
interface: "{{ dhcp_interface2 }}"
|
||||
- name: "Backup the /etc/resolv.conf for initscript"
|
||||
command: cp -vf /etc/resolv.conf /etc/resolv.conf.bak
|
||||
when:
|
||||
- network_provider == "initscripts"
|
||||
changed_when: false
|
||||
- name: Test bond device using deprecated 'master' argument
|
||||
block:
|
||||
- name: "TEST Add Bond with 2 ports using deprecated 'master' argument"
|
||||
|
|
@ -113,3 +118,8 @@
|
|||
changed_when: false
|
||||
- name: Import the task 'remove_test_interfaces_with_dhcp.yml'
|
||||
import_tasks: tasks/remove_test_interfaces_with_dhcp.yml
|
||||
- name: "Restore the /etc/resolv.conf for initscript"
|
||||
command: mv -vf /etc/resolv.conf.bak /etc/resolv.conf
|
||||
when:
|
||||
- network_provider == "initscripts"
|
||||
changed_when: false
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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 }}
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue