From 5ad0f9d571cf09581e04a6e39fe85b81a89308f0 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Wed, 5 Sep 2018 13:29:18 +0100 Subject: [PATCH] Ensure dashboard plugins are found by py_pkgs The py_pkgs plugin cannot interpret jinja, so it ignores the current set of optional packages. This results in the repo_build process ignoring them all, ultimately resulting in the heat role failing because it cannot find the wheel it needs in what the repo build has produced - nor can it go out to get it from pypi because it's restricted by pip.conf from doing so. For now, until we are able to eliminate pip.conf or change the build process to allow the role wheel builds to go out to pypi, we ensure that py_pkgs will pick up and build these packages by implementing them into individual *_optional_pip_packages lists. This matches the mechanism used in the os_neutron role. Change-Id: Ia92eb5b1355ceceada323bd075b08729afd6280f --- defaults/main.yml | 34 ++++++++++++++++++++++---------- tasks/horizon_install_source.yml | 12 ++++++++++- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 569c09f9..9bb18ee5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -328,18 +328,32 @@ horizon_pip_packages: - ply - python-memcached - python-keystoneclient - - "{{ horizon_enable_sahara_ui | ternary('sahara_dashboard', '') }}" - - "{{ horizon_enable_trove_ui | ternary('trove_dashboard', '') }}" - - "{{ horizon_enable_magnum_ui | ternary('magnum-ui', '') }}" - - "{{ horizon_enable_heat_ui | ternary('heat_dashboard', '') }}" - - "{{ horizon_enable_ironic_ui | ternary('ironic-ui', '') }}" - - "{{ horizon_enable_designate_ui | ternary('designate_dashboard', '') }}" - - "{{ horizon_enable_neutron_lbaas | ternary('neutron-lbaas-dashboard', '') }}" - - "{{ horizon_enable_neutron_fwaas | ternary('neutron-fwaas-dashboard', '') }}" - - "{{ horizon_enable_octavia_ui | ternary('octavia_dashboard', '') }}" + +# Optional pip packages for additional dashboards +# TODO(odyssey4me): +# Simplify this when we are no longer using the py_pkgs plugin +horizon_designate_optional_pip_packages: + - designate_dashboard +horizon_heat_optional_pip_packages: + - heat_dashboard +horizon_ironic_optional_pip_packages: + - ironic-ui +horizon_magnum_optional_pip_packages: + - magnum-ui +horizon_neutron_fwaas_optional_pip_packages: + - neutron-fwaas-dashboard +horizon_neutron_lbaas_optional_pip_packages: + - neutron-lbaas-dashboard +horizon_octavia_optional_pip_packages: + - octavia_dashboard +horizon_sahara_optional_pip_packages: + - sahara_dashboard +horizon_trove_optional_pip_packages: + - trove_dashboard # This variable is used to install additional pip packages -# that could be needed for additional dashboards +# that could be needed for additional dashboards required +# which are not part of the standard set above. horizon_optional_pip_packages: [] # This variable is used to update the horizon translations from diff --git a/tasks/horizon_install_source.yml b/tasks/horizon_install_source.yml index 269aa4eb..1e0fc077 100644 --- a/tasks/horizon_install_source.yml +++ b/tasks/horizon_install_source.yml @@ -67,7 +67,17 @@ venv_install_destination_path: "{{ horizon_bin | dirname }}" venv_install_distro_package_list: "{{ horizon_distro_packages }}" venv_pip_install_args: "{{ horizon_pip_install_args }}" - venv_pip_packages: "{{ horizon_pip_packages + horizon_optional_pip_packages }}" + venv_pip_packages: >- + {{ horizon_pip_packages + horizon_optional_pip_packages + + (horizon_enable_designate_ui | bool) | ternary(horizon_designate_optional_pip_packages, []) + + (horizon_enable_heat_ui | bool) | ternary(horizon_heat_optional_pip_packages, []) + + (horizon_enable_ironic_ui | bool) | ternary(horizon_ironic_optional_pip_packages, []) + + (horizon_enable_magnum_ui | bool) | ternary(horizon_magnum_optional_pip_packages, []) + + (horizon_enable_neutron_fwaas | bool) | ternary(horizon_neutron_fwaas_optional_pip_packages, []) + + (horizon_enable_neutron_lbaas | bool) | ternary(horizon_neutron_lbaas_optional_pip_packages, []) + + (horizon_enable_octavia_ui | bool) | ternary(horizon_octavia_optional_pip_packages, []) + + (horizon_enable_sahara_ui | bool) | ternary(horizon_sahara_optional_pip_packages, []) + + (horizon_enable_trove_ui | bool) | ternary(horizon_trove_optional_pip_packages, []) }} venv_facts_when_changed: - section: "horizon" option: "venv_tag"