diff --git a/playbooks/base/pre.yaml b/playbooks/base/pre.yaml index d43e05a..9d8be66 100644 --- a/playbooks/base/pre.yaml +++ b/playbooks/base/pre.yaml @@ -46,3 +46,19 @@ - mirror-info - role: configure-mirrors set_apt_mirrors_trusted: True + post_tasks: + - name: Pin importlib-resources to 1.0.2 to fix Virtualenv and Tox + become: yes + shell: | + if type -p pip3 ; then + # Tox and virtualenv will be python3 installed on platforms with pip3 + pip3 install --upgrade importlib-resources==1.0.2 + else + # Centos 7 shouldnt have python3 by default and need a pip2 install + pip install --upgrade importlib-resources==1.0.2 + fi + args: + executable: /bin/bash + # Do our best but if we fail don't cause job to fail as it may run + # happily without virtualenv or tox. + failed_when: false