heathdbrown / research

Things to look at it or that interest me.
0 stars 0 forks source link

Pipx running Ansible behind a proxy #32

Closed heathdbrown closed 2 years ago

heathdbrown commented 2 years ago

Researching how to run pipx behind a proxy.

Background documents

Attempted the following workarounds:

Current Issue using behind proxy

$ pipx install ansible --include-deps --verbose
pipx >(setup:729): pipx version is 1.0.0
pipx >(setup:730): Default python interpreter is '/usr/bin/python3'
pipx >(package_name_from_spec:323): Determined package name: ansible
pipx >(package_name_from_spec:324): Package name determined in 0.0s
creating virtual environment...
pipx >(run_subprocess:172): running /usr/bin/python3 -m venv --without-pip /home/heathdbrown/.local/pipx/venvs/ansible
pipx >(run_subprocess:172): running /home/heathdbrown/.local/pipx/venvs/ansible/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:172): running /home/heathdbrown/.local/pipx/shared/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:172): running /home/heathdbrown/.local/pipx/venvs/ansible/bin/python --version
pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: ansible
installing ansible...
pipx >(run_subprocess:172): running /home/heathdbrown/.local/pipx/venvs/ansible/bin/python -m pip install ansible
pipx >(run_subprocess:172): running <fetch_info_in_venv commands>
pipx >(get_venv_metadata_for_package:303): get_venv_metadata_for_package: 5189ms
pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: ansible
pipx >(rmdir:55): removing directory /home/heathdbrown/.local/pipx/venvs/ansible

No apps associated with package ansible or its dependencies. If you are attempting to install a library, pipx should
not be used. Consider using pip or a similar tool instead.

Things that DO work

heathdbrown commented 2 years ago

Ok, so I got this to work behind a proxy with passing args:

The only issue afterwards was a missing paramiko dependency.

see research/python/pipx.md

pipx install --include-deps ansible --pip-args "--proxy http://proxy.com:80" --verbose