main: add a retry/until for python installation

Add a retry/until in raw_install_python.yml to avoid unexpected
repository failures.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/3620/head
Guillaume Abrioux 2019-02-18 15:45:36 +01:00 committed by Sébastien Han
parent 85296c25c4
commit 7f7f3769b3
3 changed files with 16 additions and 8 deletions

View File

@ -8,17 +8,23 @@
- name: install python for debian based systems - name: install python for debian based systems
raw: apt-get -y install python-simplejson raw: apt-get -y install python-simplejson
ignore_errors: yes ignore_errors: yes
register: result
when: when:
- systempython.stat is undefined or not systempython.stat.exists - systempython.stat is undefined or not systempython.stat.exists
until: result is succeeded
- name: install python for fedora - name: install python for fedora
raw: dnf -y install python3; ln -sf /usr/bin/python3 /usr/bin/python creates=/usr/bin/python raw: dnf -y install python3; ln -sf /usr/bin/python3 /usr/bin/python creates=/usr/bin/python
ignore_errors: yes ignore_errors: yes
register: result
when: when:
- systempython.stat is undefined or not systempython.stat.exists - systempython.stat is undefined or not systempython.stat.exists
until: (result is succeeded) or ('Failed' not in result.stdout)
- name: install python for opensuse - name: install python for opensuse
raw: zypper -n install python-base creates=/usr/bin/python2.7 raw: zypper -n install python-base creates=/usr/bin/python2.7
ignore_errors: yes ignore_errors: yes
register: result
when: when:
- systempython.stat is undefined or not systempython.stat.exists - systempython.stat is undefined or not systempython.stat.exists
until: result is succeeded

View File

@ -46,9 +46,11 @@
- name: install required packages for fedora > 23 - name: install required packages for fedora > 23
raw: sudo dnf -y install python2-dnf libselinux-python ntp raw: sudo dnf -y install python2-dnf libselinux-python ntp
register: result
when: when:
- ansible_distribution == 'Fedora' - ansible_distribution == 'Fedora'
- ansible_distribution_major_version|int >= 23 - ansible_distribution_major_version|int >= 23
until: result is succeeded
- name: check if it is atomic host - name: check if it is atomic host
stat: stat:

14
tox.ini
View File

@ -71,7 +71,7 @@ commands=
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
" "
# test that the cluster can be redeployed in a healthy state # test that the cluster can be redeployed in a healthy state
testinfra -n 8 --durations=0 -rfEsxXpP --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests testinfra -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests
[purge-lvm] [purge-lvm]
commands= commands=
@ -99,7 +99,7 @@ commands=
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
" "
# test that the cluster can be redeployed in a healthy state # test that the cluster can be redeployed in a healthy state
testinfra -n 8 --durations=0 -rfEsxXpP --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests testinfra -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests
# extra commands for performing a rolling update # extra commands for performing a rolling update
[update] [update]
@ -116,7 +116,7 @@ commands=
ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest} \ ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest} \
" "
bash -c "CEPH_STABLE_RELEASE={env:UPDATE_CEPH_STABLE_RELEASE:nautilus} testinfra -n 8 --durations=0 -rfEsxXpP --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests" bash -c "CEPH_STABLE_RELEASE={env:UPDATE_CEPH_STABLE_RELEASE:nautilus} testinfra -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests"
[shrink-mon] [shrink-mon]
commands= commands=
@ -150,7 +150,7 @@ commands=
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
" "
testinfra -n 8 --durations=0 -rfEsxXpP --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-switch-to-containers {toxinidir}/tests/functional/tests testinfra -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-switch-to-containers {toxinidir}/tests/functional/tests
[add-osds] [add-osds]
commands= commands=
@ -167,7 +167,7 @@ commands=
ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
" "
testinfra -n 8 --durations=0 -rfEsxXpP --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 {toxinidir}/tests/functional/tests testinfra -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 {toxinidir}/tests/functional/tests
[rgw-multisite] [rgw-multisite]
commands= commands=
@ -312,7 +312,7 @@ commands=
# wait 30sec for services to be ready # wait 30sec for services to be ready
sleep 30 sleep 30
# test cluster state using ceph-ansible tests # test cluster state using ceph-ansible tests
testinfra -n 8 --durations=0 -rfEsxXpP --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests testinfra -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests
# reboot all vms # reboot all vms
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/reboot.yml ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/reboot.yml
@ -320,7 +320,7 @@ commands=
# wait 30sec for services to be ready # wait 30sec for services to be ready
sleep 30 sleep 30
# retest to ensure cluster came back up correctly after rebooting # retest to ensure cluster came back up correctly after rebooting
testinfra -n 8 --durations=0 -rfEsxXpP --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests testinfra -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests
# handlers/idempotency test # handlers/idempotency test
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} \ ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} \