aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-08-19 02:03:10 +0000
committerGerrit Code Review <review@openstack.org>2016-08-19 02:03:10 +0000
commit34bff50602c14c8370b077274f2aea1461c4bc49 (patch)
tree89d1b7317f36babf2e46aa8a5c820a152543b83c
parent03b9ecc3df6a133b3d6dc06a144bbdae4705f344 (diff)
parent9ac7f966526f0f04123852180af8a8d1d50b1b7f (diff)
downloadkolla-34bff50602c14c8370b077274f2aea1461c4bc49.tar.gz
kolla-34bff50602c14c8370b077274f2aea1461c4bc49.zip
Merge "Create the _member_ role in the horizon role"
-rw-r--r--ansible/roles/horizon/defaults/main.yml12
-rw-r--r--ansible/roles/horizon/tasks/deploy.yml2
-rw-r--r--ansible/roles/horizon/tasks/register.yml13
-rw-r--r--ansible/roles/horizon/templates/local_settings.j22
4 files changed, 28 insertions, 1 deletions
diff --git a/ansible/roles/horizon/defaults/main.yml b/ansible/roles/horizon/defaults/main.yml
index fe2e88437..e07b9ba0a 100644
--- a/ansible/roles/horizon/defaults/main.yml
+++ b/ansible/roles/horizon/defaults/main.yml
@@ -7,3 +7,15 @@ project_name: "horizon"
horizon_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-horizon"
horizon_tag: "{{ openstack_release }}"
horizon_image_full: "{{ horizon_image }}:{{ horizon_tag }}"
+
+
+####################
+# OpenStack
+####################
+openstack_horizon_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}"
+
+
+####################
+# Horizon
+####################
+horizon_openstack_keystone_default_role: "_member_"
diff --git a/ansible/roles/horizon/tasks/deploy.yml b/ansible/roles/horizon/tasks/deploy.yml
index 1f16915ad..16fae2dad 100644
--- a/ansible/roles/horizon/tasks/deploy.yml
+++ b/ansible/roles/horizon/tasks/deploy.yml
@@ -1,4 +1,6 @@
---
- include: config.yml
+- include: register.yml
+
- include: start.yml
diff --git a/ansible/roles/horizon/tasks/register.yml b/ansible/roles/horizon/tasks/register.yml
new file mode 100644
index 000000000..0c78e9821
--- /dev/null
+++ b/ansible/roles/horizon/tasks/register.yml
@@ -0,0 +1,13 @@
+---
+- name: Creating the _member_ role
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
+ -m os_keystone_role
+ -a "name={{ horizon_openstack_keystone_default_role }}
+ auth={{ '{{ openstack_horizon_auth }}' }}"
+ -e "{'openstack_horizon_auth':{{ openstack_horizon_auth }}}"
+ register: horizon_role
+ changed_when: "{{ horizon_role.stdout.find('localhost | SUCCESS => ') != -1 and (horizon_role.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
+ until: horizon_role.stdout.split()[2] == 'SUCCESS'
+ retries: 10
+ delay: 5
+ run_once: True
diff --git a/ansible/roles/horizon/templates/local_settings.j2 b/ansible/roles/horizon/templates/local_settings.j2
index 4e41d4bad..9d476c7d6 100644
--- a/ansible/roles/horizon/templates/local_settings.j2
+++ b/ansible/roles/horizon/templates/local_settings.j2
@@ -160,7 +160,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
OPENSTACK_HOST = "{{ kolla_internal_fqdn }}"
OPENSTACK_KEYSTONE_URL = "{{ keystone_public_url }}"
-OPENSTACK_KEYSTONE_DEFAULT_ROLE = "_member_"
+OPENSTACK_KEYSTONE_DEFAULT_ROLE = "{{ horizon_openstack_keystone_default_role }}"
# Enables keystone web single-sign-on if set to True.
#WEBSSO_ENABLED = False