Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Python system-wide packages toggle
Browse files Browse the repository at this point in the history
Allow user to use python system-wide packages.

closes: #4660
https://pulp.plan.io/issues/4660

Signed-off-by: Pavel Picka <ppicka@redhat.com>
  • Loading branch information
pavelpicka committed Apr 29, 2019
1 parent f02c6a7 commit 37812f6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/pulp/README.md
Expand Up @@ -35,6 +35,7 @@ Role Variables:
Defaults to "/var/lib/pulp".
* `pulp_api_port` Set the port the API server is served from. Defaults to '24817'.
* `pulp_api_host` Set the host the API server is served from. Defaults to 'localhost'.
* `pulp_use_system_wide_pkgs` Use python system-wide packages. Defaults to "false".

Shared Variables:
-----------------
Expand Down
1 change: 1 addition & 0 deletions roles/pulp/defaults/main.yml
Expand Up @@ -12,3 +12,4 @@ pulp_user_home: '/var/lib/pulp'
pulp_pip_editable: yes
pulp_api_host: localhost
pulp_api_port: 24817
pulp_use_system_wide_pkgs: false
10 changes: 10 additions & 0 deletions roles/pulp/tasks/install.yml
Expand Up @@ -69,6 +69,16 @@

- block:

# Hack for use system-wide packages when enabled by user - Must be first usage of virtualenv
- name: Allow use system-wide packages
pip:
name: pip
state: present
virtualenv: '{{ pulp_install_dir }}'
virtualenv_command: '{{ pulp_python_interpreter }} -m venv'
virtualenv_site_packages: yes
when: pulp_use_system_wide_pkgs

- name: Install the psycopg python package
pip:
name: psycopg2-binary
Expand Down

0 comments on commit 37812f6

Please sign in to comment.