diff --git a/roles/python/tasks/Unix.yaml b/roles/python/tasks/Unix.yaml index 06acf82..5210943 100644 --- a/roles/python/tasks/Unix.yaml +++ b/roles/python/tasks/Unix.yaml @@ -28,8 +28,15 @@ dest: ~/.pylintrc - src: ~/.config/python/ipython_config.py dest: ~/.config/ipython/profile_default/ipython_config.py - - src: ~/.config/python/pip.conf - dest: ~/.config/pip/pip.conf + +# TODO: remove this symbolic link if it exists, don't remove a regular file + # - src: ~/.config/python/pip.conf + # dest: ~/.config/pip/pip.conf + +- name: create pip.conf from template + template: + src: pip.conf.j2 + dest: ~/.config/pip/pip.conf - name: install pip packages pip: diff --git a/roles/python/templates/pip.conf.j2 b/roles/python/templates/pip.conf.j2 new file mode 100644 index 0000000..04be926 --- /dev/null +++ b/roles/python/templates/pip.conf.j2 @@ -0,0 +1,8 @@ +[global] +break-system-packages = true +{% if ansible_env.http_proxy is defined %} +proxy = {{ ansible_env.http_proxy }} +{% endif %} + +[list] +format=columns