diff --git a/defaults/main.yml b/defaults/main.yml index 17ef5acb..d1b59af3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -256,6 +256,10 @@ horizon_pip_packages: - sahara_dashboard - trove_dashboard +# This variable is used to install additional pip packages +# that could be needed for additional dashboards +horizon_optional_pip_packages: [] + # This variable is used by the repo_build process to determine # which host group to check for members of before building the # pip packages required by this role. The value is picked up diff --git a/tasks/horizon_install.yml b/tasks/horizon_install.yml index 7d492ba9..7592c866 100644 --- a/tasks/horizon_install.yml +++ b/tasks/horizon_install.yml @@ -120,6 +120,22 @@ - horizon_get_venv | failed or horizon_developer_mode | bool notify: Restart apache2 +- name: Install optional pip packages + pip: + name: "{{ horizon_optional_pip_packages | join(' ') }}" + state: "{{ horizon_pip_package_state }}" + virtualenv: "{{ horizon_bin | dirname }}" + virtualenv_site_packages: "no" + extra_args: >- + {{ horizon_developer_mode | ternary('--constraint /opt/developer-pip-constraints.txt', '') }} + {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} + {{ pip_install_options | default('') }} + register: install_packages + until: install_packages|success + retries: 5 + delay: 2 + when: horizon_optional_pip_packages | length > 0 + - name: Update virtualenv path command: > virtualenv-tools --update-path=auto {{ horizon_bin | dirname }}