diff --git a/playbooks/base-test/pre.yaml b/playbooks/base-test/pre.yaml index ea4e8fa..b7ff1b6 100644 --- a/playbooks/base-test/pre.yaml +++ b/playbooks/base-test/pre.yaml @@ -34,3 +34,7 @@ - mirror-info - role: configure-mirrors set_apt_mirrors_trusted: True + # NOTE(ianw): 2020-03-27 : broken setuptools, until + # https://github.com/pypa/virtualenv/issues/1752 + # releases + - virtualenv-config diff --git a/roles/virtualenv-config/README.rst b/roles/virtualenv-config/README.rst new file mode 100644 index 0000000..ea1dff4 --- /dev/null +++ b/roles/virtualenv-config/README.rst @@ -0,0 +1,11 @@ +Write a configuration file for virtualenv + +Generally we do not require any specific virtualenv configuration. +However, there are corner cases; such as virtualenv shipping an +vendored version of setuptools that needs to be ignored or similar. + +The exact action this role is taking may depend on any issues it is +working around. See comments inline. + +** Role Variables ** + diff --git a/roles/virtualenv-config/tasks/main.yaml b/roles/virtualenv-config/tasks/main.yaml new file mode 100644 index 0000000..77c54d6 --- /dev/null +++ b/roles/virtualenv-config/tasks/main.yaml @@ -0,0 +1,19 @@ +- name: Set config file + set_fact: + virtualenv_config_file: '{{ ansible_env.HOME }}/.config/virtualenv/virtualenv.ini' + +- name: Ensure config directory + file: + path: '{{ virtualenv_config_file | dirname }}' + state: directory + mode: 0755 + +# NOTE(ianw) : 2020-03-27 workaround 46.1.1 broken setuptools +# https://github.com/pypa/virtualenv/issues/1752 +- name: Add download flag, to not use vendorded versions of setuptools/pip + ini_file: + path: '{{ virtualenv_config_file }}' + section: 'virtualenv' + option: download + value: 'True' + mode: '0644'