From fbb4e1ca73fd39ce9f18fa7c6f05766ccb0e484a Mon Sep 17 00:00:00 2001 From: Luke Meyer Date: Tue, 28 Nov 2017 15:46:50 -0500 Subject: retry package operations When a package install/update fails due to network blips or other spotty availability, retry it. If the failure is a real failure (e.g. package is really not there) it still fails after 3 tries (Ansible default). --- playbooks/adhoc/uninstall.yml | 10 ++++++++++ .../common/openshift-cluster/upgrades/docker/tasks/upgrade.yml | 2 ++ playbooks/init/facts.yml | 4 ++++ playbooks/openshift-node/private/network_manager.yml | 2 ++ 4 files changed, 18 insertions(+) (limited to 'playbooks') diff --git a/playbooks/adhoc/uninstall.yml b/playbooks/adhoc/uninstall.yml index 5ed55a817..0c2a2c7e8 100644 --- a/playbooks/adhoc/uninstall.yml +++ b/playbooks/adhoc/uninstall.yml @@ -126,10 +126,14 @@ - origin-sdn-ovs - tuned-profiles-openshift-node - tuned-profiles-origin-node + register: result + until: result | success - name: Remove flannel package package: name=flannel state=absent when: openshift_use_flannel | default(false) | bool + register: result + until: result | success when: not is_atomic | bool - shell: systemctl reset-failed @@ -382,6 +386,8 @@ - origin-master - pacemaker - pcs + register: result + until: result | success - shell: systemctl reset-failed changed_when: False @@ -497,6 +503,8 @@ with_items: - etcd - etcd3 + register: result + until: result | success - shell: systemctl reset-failed changed_when: False @@ -554,6 +562,8 @@ when: not is_atomic | bool and openshift_remove_all | default(True) | bool with_items: - haproxy + register: result + until: result | success - shell: systemctl reset-failed changed_when: False diff --git a/playbooks/common/openshift-cluster/upgrades/docker/tasks/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/docker/tasks/upgrade.yml index 808cc562c..83be290e6 100644 --- a/playbooks/common/openshift-cluster/upgrades/docker/tasks/upgrade.yml +++ b/playbooks/common/openshift-cluster/upgrades/docker/tasks/upgrade.yml @@ -41,6 +41,8 @@ - name: Upgrade Docker package: name=docker{{ '-' + docker_version }} state=present + register: result + until: result | success - include: restart.yml when: not skip_docker_restart | default(False) | bool diff --git a/playbooks/init/facts.yml b/playbooks/init/facts.yml index 05142f9b6..1166ac538 100644 --- a/playbooks/init/facts.yml +++ b/playbooks/init/facts.yml @@ -84,6 +84,8 @@ - "{{ 'python3-dbus' if ansible_distribution == 'Fedora' else 'dbus-python' }}" - "{{ 'python3-PyYAML' if ansible_distribution == 'Fedora' else 'PyYAML' }}" - yum-utils + register: result + until: result | success - name: Ensure various deps for running system containers are installed package: @@ -100,6 +102,8 @@ or (openshift_use_openvswitch_system_container | default(False)) | bool or (openshift_use_node_system_container | default(False)) | bool or (openshift_use_master_system_container | default(False)) | bool + register: result + until: result | success - name: Gather Cluster facts and set is_containerized if needed openshift_facts: diff --git a/playbooks/openshift-node/private/network_manager.yml b/playbooks/openshift-node/private/network_manager.yml index fffed4dfb..7211787be 100644 --- a/playbooks/openshift-node/private/network_manager.yml +++ b/playbooks/openshift-node/private/network_manager.yml @@ -9,6 +9,8 @@ package: name: 'NetworkManager' state: present + register: result + until: result | success - name: configure NetworkManager lineinfile: -- cgit v1.2.3