Re-written dashboards linking.
Old style of dashboards linking was replaced with find module. horizon_panels variable was removed. Now deployer may install extra dashboard with pip package, and it will be linked by role in case of correct structure and naming. Task for linking found dashboards was moved to horizon_install_source, as we don't need linking during installation from packages. Added _dashboard_panels_location - it's a list with subdirs inside dashboard folders, where panels should be located. horizon_panel_enable_state variable was also removed, as we don't try to link dashboards in post_install anymore. Depends-on: I708b5cf32e5cce6a18624d0b3be0cd4c828ad389 Change-Id: Ia76d959aa03ff67703bd41bd7ea418ea49a91df7
This commit is contained in:
parent
c60204dbb9
commit
3d60097f94
@ -320,23 +320,23 @@ horizon_pip_packages:
|
|||||||
- django-appconf
|
- django-appconf
|
||||||
- django-openstack-auth
|
- django-openstack-auth
|
||||||
- greenlet
|
- greenlet
|
||||||
- heat_dashboard
|
|
||||||
- horizon
|
- horizon
|
||||||
- ironic-ui
|
|
||||||
- magnum-ui
|
|
||||||
- keystonemiddleware
|
- keystonemiddleware
|
||||||
- MySQL-python
|
- MySQL-python
|
||||||
- PyMySQL
|
- PyMySQL
|
||||||
- neutron-lbaas-dashboard
|
|
||||||
- neutron-fwaas-dashboard
|
|
||||||
- oslo.config
|
- oslo.config
|
||||||
- ply
|
- ply
|
||||||
- python-memcached
|
- python-memcached
|
||||||
- python-keystoneclient
|
- python-keystoneclient
|
||||||
- sahara_dashboard
|
- "{{ horizon_enable_sahara_ui | ternary('sahara_dashboard', '') }}"
|
||||||
- trove_dashboard
|
- "{{ horizon_enable_trove_ui | ternary('trove_dashboard', '') }}"
|
||||||
- designate_dashboard
|
- "{{ horizon_enable_magnum_ui | ternary('magnum-ui', '') }}"
|
||||||
- octavia_dashboard
|
- "{{ 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', '') }}"
|
||||||
|
|
||||||
# This variable is used to install additional pip packages
|
# This variable is used to install additional pip packages
|
||||||
# that could be needed for additional dashboards
|
# that could be needed for additional dashboards
|
||||||
@ -373,5 +373,3 @@ horizon_keystone_admin_roles:
|
|||||||
# The list of authentication mechanisms which include keystone
|
# The list of authentication mechanisms which include keystone
|
||||||
# federation protocols and identity provider/federation protocol
|
# federation protocols and identity provider/federation protocol
|
||||||
horizon_websso_initial_choice: "credentials"
|
horizon_websso_initial_choice: "credentials"
|
||||||
|
|
||||||
horizon_panels: "{{ _horizon_panels }}"
|
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
- name: Install distro packages
|
- name: Install distro packages
|
||||||
package:
|
package:
|
||||||
name: "{{ horizon_package_list}}"
|
name: "{{ horizon_package_list }}"
|
||||||
state: "{{ horizon_package_state }}"
|
state: "{{ horizon_package_state }}"
|
||||||
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
|
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
|
||||||
cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}"
|
cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}"
|
||||||
|
@ -92,3 +92,41 @@
|
|||||||
- { path: "{{ horizon_lib_dir }}/openstack_dashboard", mode: "2755" }
|
- { path: "{{ horizon_lib_dir }}/openstack_dashboard", mode: "2755" }
|
||||||
- { path: "{{ horizon_lib_dir }}/openstack_dashboard/local", mode: "2755" }
|
- { path: "{{ horizon_lib_dir }}/openstack_dashboard/local", mode: "2755" }
|
||||||
- { path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled", mode: "2755" }
|
- { path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled", mode: "2755" }
|
||||||
|
|
||||||
|
- name: Registering dashboards
|
||||||
|
find:
|
||||||
|
paths: "{{ horizon_lib_dir }}"
|
||||||
|
patterns: "^.*(dashboard|ui)$"
|
||||||
|
file_type: directory
|
||||||
|
use_regex: yes
|
||||||
|
excludes: "openstack_dashboard"
|
||||||
|
recurse: no
|
||||||
|
register: found_dashboards
|
||||||
|
|
||||||
|
# NOTE(noonedeadpunk):
|
||||||
|
# patterns made not optimal, as ansible find module doesn't
|
||||||
|
# process regexp with repeats, like [0-9]{2,4}.
|
||||||
|
# Bug describing this issue:
|
||||||
|
# https://github.com/ansible/ansible/issues/45048
|
||||||
|
- name: Registering panels
|
||||||
|
find:
|
||||||
|
paths: |-
|
||||||
|
{% set dashboard_path = [] %}
|
||||||
|
{% for dashboard in found_dashboards.files %}
|
||||||
|
{% for path in _dashboard_panels_location %}
|
||||||
|
{% set _ = dashboard_path.append(dashboard.path + path) %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
{{ dashboard_path }}
|
||||||
|
patterns: "^(_[0-9]{4}_.*.py|_[0-9]{2}_.*.py|.*_policy.json)$"
|
||||||
|
file_type: file
|
||||||
|
use_regex: yes
|
||||||
|
register: found_panels
|
||||||
|
|
||||||
|
- name: Enable project panels
|
||||||
|
file:
|
||||||
|
src: "{{ item.path }}"
|
||||||
|
path: "{{ horizon_dashboard_panel_dir }}/{{ item.path|basename }}"
|
||||||
|
state: link
|
||||||
|
with_items: "{{ found_panels.files }}"
|
||||||
|
notify: Restart apache2
|
||||||
|
@ -48,14 +48,6 @@
|
|||||||
dest: "{{ horizon_lib_dir }}/openstack_dashboard/static/dashboard/{{ item.value.dest }}"
|
dest: "{{ horizon_lib_dir }}/openstack_dashboard/static/dashboard/{{ item.value.dest }}"
|
||||||
with_dict: "{{ horizon_custom_uploads | default({}) }}"
|
with_dict: "{{ horizon_custom_uploads | default({}) }}"
|
||||||
|
|
||||||
- name: Enable project panels
|
|
||||||
file:
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
path: "{{ item.path }}"
|
|
||||||
state: "{{ item.state }}"
|
|
||||||
with_items: "{{ horizon_panels }}"
|
|
||||||
notify: Restart apache2
|
|
||||||
|
|
||||||
- name: Create horizon links
|
- name: Create horizon links
|
||||||
file:
|
file:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
|
@ -17,6 +17,3 @@ horizon_package_list: "{{ horizon_distro_packages + horizon_service_distro_packa
|
|||||||
|
|
||||||
_horizon_bin: "/usr/bin"
|
_horizon_bin: "/usr/bin"
|
||||||
horizon_manage: "{{ ansible_python.executable }} {{ horizon_lib_dir }}/manage.py"
|
horizon_manage: "{{ ansible_python.executable }} {{ horizon_lib_dir }}/manage.py"
|
||||||
# NOTE(hwoarang): Distributions ship regular files in _horizon_lib_dir so we need
|
|
||||||
# to set the proper state in the file module
|
|
||||||
horizon_panel_enable_state: "file"
|
|
||||||
|
@ -13,104 +13,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
_horizon_panels:
|
|
||||||
- src: "{{ horizon_lib_dir }}/heat_dashboard/enabled/_1610_project_orchestration_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1610_project_orchestration_panel.py"
|
|
||||||
state: "{{ horizon_enable_heat_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/heat_dashboard/enabled/_1620_project_stacks_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1620_project_stacks_panel.py"
|
|
||||||
state: "{{ horizon_enable_heat_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/heat_dashboard/enabled/_1630_project_resource_types_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1630_project_resource_types_panel.py"
|
|
||||||
state: "{{ horizon_enable_heat_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/heat_dashboard/enabled/_1640_project_template_versions_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1640_project_template_versions_panel.py"
|
|
||||||
state: "{{ horizon_enable_heat_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/heat_dashboard/enabled/_1650_project_template_generator_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1650_project_template_generator_panel.py"
|
|
||||||
state: "{{ horizon_enable_heat_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/heat_dashboard/local_settings.d/_1699_orchestration_settings.py"
|
|
||||||
path: "{{ horizon_lib_dir }}/openstack_dashboard/local/local_settings.d/_1699_orchestration_settings.py"
|
|
||||||
state: "{{ horizon_enable_heat_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/heat_dashboard/conf/heat_policy.json"
|
|
||||||
path: "{{ horizon_lib_dir }}/openstack_dashboard/conf/heat_policy.json"
|
|
||||||
state: "{{ horizon_enable_heat_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/designatedashboard/enabled/_1710_project_dns_panel_group.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1710_project_dns_panel_group.py"
|
|
||||||
state: "{{ horizon_enable_designate_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/designatedashboard/enabled/_1720_project_dns_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1720_project_dns_panel.py"
|
|
||||||
state: "{{ horizon_enable_designate_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/designatedashboard/enabled/_1721_dns_zones_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1721_dns_zones_panel.py"
|
|
||||||
state: "{{ horizon_enable_designate_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/designatedashboard/enabled/_1722_dns_reversedns_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1722_dns_reversedns_panel.py"
|
|
||||||
state: "{{ horizon_enable_designate_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/ironic_ui/enabled/_2200_ironic.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_2200_ironic.py"
|
|
||||||
state: "{{ horizon_enable_ironic_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/magnum_ui/enabled/_1370_project_container_infra_panel_group.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1370_project_container_infra_panel_group.py"
|
|
||||||
state: "{{ horizon_enable_magnum_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/magnum_ui/enabled/_1371_project_container_infra_clusters_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1371_project_container_infra_clusters_panel.py"
|
|
||||||
state: "{{ horizon_enable_magnum_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/magnum_ui/enabled/_1372_project_container_infra_cluster_templates_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1372_project_container_infra_cluster_templates_panel.py"
|
|
||||||
state: "{{ horizon_enable_magnum_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/sahara_dashboard/enabled/_1810_data_processing_panel_group.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1810_data_processing_panel_group.py"
|
|
||||||
state: "{{ horizon_enable_sahara_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/sahara_dashboard/enabled/_1820_data_processing_clusters_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1820_data_processing_clusters_panel.py"
|
|
||||||
state: "{{ horizon_enable_sahara_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/sahara_dashboard/enabled/_1830_data_processing_plugins_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1830_data_processing_plugins_panel.py"
|
|
||||||
state: "{{ horizon_enable_sahara_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/sahara_dashboard/enabled/_1840_data_processing_jobs_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1840_data_processing_jobs_panel.py"
|
|
||||||
state: "{{ horizon_enable_sahara_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/sahara_dashboard/local_settings.d/_12_toggle_data_upload_max_number_fields.py"
|
|
||||||
path: "{{ horizon_lib_dir }}/openstack_dashboard/local/local_settings.d/_12_toggle_data_upload_max_number_fields.py"
|
|
||||||
state: "{{ horizon_enable_sahara_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/trove_dashboard/enabled/_1710_database_panel_group.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1710_database_panel_group.py"
|
|
||||||
state: "{{ horizon_enable_trove_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/trove_dashboard/enabled/_1720_project_databases_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1720_project_databases_panel.py"
|
|
||||||
state: "{{ horizon_enable_trove_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/trove_dashboard/enabled/_1730_project_database_backups_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1730_project_database_backups_panel.py"
|
|
||||||
state: "{{ horizon_enable_trove_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/trove_dashboard/enabled/_1731_project_database_backups_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1731_project_database_backups_panel.py"
|
|
||||||
state: "{{ horizon_enable_trove_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/trove_dashboard/enabled/_1740_project_database_clusters_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1740_project_database_clusters_panel.py"
|
|
||||||
state: "{{ horizon_enable_trove_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/trove_dashboard/enabled/_1760_project_database_configurations_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1760_project_database_configurations_panel.py"
|
|
||||||
state: "{{ horizon_enable_trove_ui | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/neutron_lbaas_dashboard/enabled/_1481_project_ng_loadbalancersv2_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1481_project_ng_loadbalancersv2_panel.py"
|
|
||||||
state: "{{ (horizon_enable_neutron_lbaas | bool) | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/neutron_fwaas_dashboard/enabled/_7010_project_firewalls_common.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_7010_project_firewalls_common.py"
|
|
||||||
state: "{{ (horizon_enable_neutron_fwaas | bool) | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/neutron_fwaas_dashboard/enabled/_7011_project_firewalls_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_7011_project_firewalls_panel.py"
|
|
||||||
state: "{{ (horizon_enable_neutron_fwaas | bool) | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/neutron_fwaas_dashboard/enabled/_7012_project_firewalls_v2_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_7012_project_firewalls_v2_panel.py"
|
|
||||||
state: "{{ (horizon_enable_neutron_fwaas | bool) | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
- src: "{{ horizon_lib_dir }}/octavia_dashboard/enabled/_1482_project_load_balancer_panel.py"
|
|
||||||
path: "{{ horizon_dashboard_panel_dir }}/_1482_project_load_balancer_panel.py"
|
|
||||||
state: "{{ (horizon_enable_octavia_ui | bool) | ternary(horizon_panel_enable_state, 'absent') }}"
|
|
||||||
|
|
||||||
_horizon_translations_pull:
|
_horizon_translations_pull:
|
||||||
- project: "horizon"
|
- project: "horizon"
|
||||||
enabled: True
|
enabled: True
|
||||||
- project: "heat-dashboard"
|
- project: "heat-dashboard"
|
||||||
enabled: "{{ horizon_enable_heat_ui }}"
|
enabled: "{{ horizon_enable_heat_ui }}"
|
||||||
|
|
||||||
|
@ -17,5 +17,8 @@ _horizon_bin: "/openstack/venvs/horizon-{{ horizon_venv_tag }}/bin"
|
|||||||
_horizon_lib_dir: "{{ _horizon_bin | dirname }}/lib/python2.7/dist-packages"
|
_horizon_lib_dir: "{{ _horizon_bin | dirname }}/lib/python2.7/dist-packages"
|
||||||
horizon_python_lib_dir: "{{ _horizon_lib_dir }}"
|
horizon_python_lib_dir: "{{ _horizon_lib_dir }}"
|
||||||
horizon_manage: "{{ _horizon_bin }}/horizon-manage.py"
|
horizon_manage: "{{ _horizon_bin }}/horizon-manage.py"
|
||||||
horizon_panel_enable_state: "link"
|
|
||||||
horizon_dashboard_panel_dir: "{{ _horizon_lib_dir }}/openstack_dashboard/local/enabled"
|
horizon_dashboard_panel_dir: "{{ _horizon_lib_dir }}/openstack_dashboard/local/enabled"
|
||||||
|
_dashboard_panels_location:
|
||||||
|
- "/enabled"
|
||||||
|
- "/conf"
|
||||||
|
- "/local_settings.d"
|
||||||
|
Loading…
Reference in New Issue
Block a user