From: Yifei Xue Date: Sat, 16 Dec 2017 06:45:00 +0000 (+0800) Subject: Bug fix for the random failure of pip_install X-Git-Tag: opnfv-6.0.0~74 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=58ca623f89b9367c65ff07e01648c649ab64a5f2;p=compass4nfv.git Bug fix for the random failure of pip_install JIAR: - For centos deployment, it sometimes fails when run the role: pip_install due to the network is not so stable. So we add some retyies here to avoid the failure. Change-Id: I9774e5be4d42a66f8cf377ec83161b200266d3d0 Signed-off-by: Yifei Xue --- diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml index 046b25e5..ac4ce418 100755 --- a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml +++ b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml @@ -63,6 +63,18 @@ /etc/yum.repos.d/CentOS-Base.repo.bak; when: hostvars[hostvars[inventory_hostname]['groups']['controller'][0]]['local_mirror'] == 'CentOS' +- name: fix the problem in pip_install + blockinfile: + dest: /etc/ansible/roles/pip_install/tasks/pre_install_yum.yml + insertafter: 'pip_install_package_state' + block: | + # add retry + register: repo_result + until: repo_result | success + retries: 5 + delay: 10 + when: hostvars[hostvars[inventory_hostname]['groups']['controller'][0]]['local_mirror'] == 'CentOS' + - name: add mariadb local repository blockinfile: dest: /etc/openstack_deploy/user_variables.yml