From c7ebd28341d852213a0f446c6c333033bfb9f362 Mon Sep 17 00:00:00 2001 From: Nolan Brubaker Date: Wed, 17 Aug 2016 17:05:11 -0400 Subject: [PATCH] Add variable override for OPENSTACK_KEYSTONE_ADMIN_ROLES As Horizon treats admins differently and can't discern what roles are administrative in nature, we have to tell it if there are roles beyond/besides "admin". If not overriden by the user, then the default is `['admin']` as seen in the code: https://github.com/openstack/horizon/blob/stable/mitaka/openstack_dashboard/utils/identity.py#L20-L25. Closes-Bug: #1614213 Change-Id: I5e475db52be7d6390a1ab29a08b58fc102e16037 Co-Author: Corey Wright --- defaults/main.yml | 3 +++ .../add-keystone-admin-roles-setting-83198a721c64ee3c.yaml | 5 +++++ templates/horizon_local_settings.py.j2 | 6 ++++++ 3 files changed, 14 insertions(+) create mode 100644 releasenotes/notes/add-keystone-admin-roles-setting-83198a721c64ee3c.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 7f68269b..071dbcec 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -252,3 +252,6 @@ horizon_role_project_group: horizon_all # Set arbitrary horizon configuration options horizon_config_overrides: {} + +horizon_keystone_admin_roles: + - admin diff --git a/releasenotes/notes/add-keystone-admin-roles-setting-83198a721c64ee3c.yaml b/releasenotes/notes/add-keystone-admin-roles-setting-83198a721c64ee3c.yaml new file mode 100644 index 00000000..ec2f586d --- /dev/null +++ b/releasenotes/notes/add-keystone-admin-roles-setting-83198a721c64ee3c.yaml @@ -0,0 +1,5 @@ +--- +features: + - The ``horizon_keystone_admin_roles`` variable is added to support the + ``OPENSTACK_KEYSTONE_ADMIN_ROLES`` list in the horizon_local_settings.py + file. diff --git a/templates/horizon_local_settings.py.j2 b/templates/horizon_local_settings.py.j2 index 85b2a4e7..bdf528ea 100644 --- a/templates/horizon_local_settings.py.j2 +++ b/templates/horizon_local_settings.py.j2 @@ -738,3 +738,9 @@ DEFAULT_THEME = '{{ horizon_default_theme }}' # Set arbitrary horizon configuration options HORIZON_CONFIG.update({{ horizon_config_overrides }}) + +OPENSTACK_KEYSTONE_ADMIN_ROLES = [ +{% for item in horizon_keystone_admin_roles %} + '{{ item }}', +{% endfor %} +]