Ignore repo container facts gathering errors
In case of any repo container going down any attempt to build venv will fail due to failure to gather facts for them. In order to overcome the issue defaults for venv_build_targets elements are defined along with ignoring any failures for fact gathering. However failed_when is used instead of ignore_errors as ignore_errors will invalidate facts for successfull hosts as well, while failed_when preserves result for successfull hosts. As a result venv_build_targets will be populated with `none-none-none` key which will inlcude all hosts that don't have required facts in place Change-Id: I271e6464133939be4e21110042cd489dc66c8d5d
This commit is contained in:
parent
e1138cae5f
commit
f432c87744
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Python wheels build no longer fails in case of issues with a repo host
|
||||
and should succeed as long as there at least one reachable repo host
|
||||
with matching Distro/Version/Architecture.
|
@ -33,6 +33,10 @@
|
||||
gather_subset: '!all:min'
|
||||
delegate_to: "{{ item }}"
|
||||
delegate_facts: true
|
||||
# NOTE(noonedeadpunk): failed_when is used instead of ignore_errors as latter
|
||||
# results in failed task, meaning that gathered facts for
|
||||
# reachable hosts are not preserved as a result.
|
||||
failed_when: false
|
||||
with_items: "{{ groups[venv_build_group] | default([inventory_hostname]) }}"
|
||||
tags:
|
||||
- always
|
||||
|
@ -45,13 +45,13 @@
|
||||
venv_build_targets: |-
|
||||
{% set targets = {} %}
|
||||
{% for item in ((groups[venv_build_group] | default([])) | reverse) %}
|
||||
{% set distro = (hostvars[item]['ansible_facts']['distribution'] | lower) | replace(' ', '_') %}
|
||||
{% set distro = (hostvars[item]['ansible_facts']['distribution'] | default('none') | lower) | replace(' ', '_') %}
|
||||
{% if distro == 'ubuntu' %}
|
||||
{% set distro_ver = hostvars[item]['ansible_facts']['distribution_version'].split('.')[:2] | join('.') %}
|
||||
{% set distro_ver = (hostvars[item]['ansible_facts']['distribution_version'] | default('none.none')).split('.')[:2] | join('.') %}
|
||||
{% else %}
|
||||
{% set distro_ver = hostvars[item]['ansible_facts']['distribution_major_version'] %}
|
||||
{% set distro_ver = hostvars[item]['ansible_facts']['distribution_major_version'] | default('none') %}
|
||||
{% endif %}
|
||||
{% set arch = hostvars[item]['ansible_facts']['architecture'] %}
|
||||
{% set arch = hostvars[item]['ansible_facts']['architecture'] | default('none') %}
|
||||
{% set distro_arch = [distro, distro_ver, arch] | join('-') %}
|
||||
{% if distro_arch not in targets %}
|
||||
{% set _ = targets.update({distro_arch: item | string}) %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user