diff --git a/roles/os-horizon/handlers/main.yml b/roles/os-horizon/handlers/main.yml index 2abb48f..ff92642 100644 --- a/roles/os-horizon/handlers/main.yml +++ b/roles/os-horizon/handlers/main.yml @@ -15,3 +15,6 @@ - name: restart nginx service: name=nginx enabled=yes state=restarted + + - name: restart horizon + service: name=uwsgi@horizon enabled=yes state=restarted diff --git a/roles/os-horizon/tasks/configure_horizon.yml b/roles/os-horizon/tasks/configure_horizon.yml new file mode 100644 index 0000000..aae82c9 --- /dev/null +++ b/roles/os-horizon/tasks/configure_horizon.yml @@ -0,0 +1,21 @@ +--- +# Copyright (c) 2016 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + - name: Create configuration files directory + file: path=/etc/horizon/local_settings.d state=directory owner=httpd mode=550 + + - name: Create configuration file + template: src=10_host.py.j2 dest=/etc/horizon/local_settings.d/10_host.py owner=httpd mode=550 + notify: restart horizon diff --git a/roles/os-horizon/tasks/main.yml b/roles/os-horizon/tasks/main.yml index 3675aea..feb45de 100644 --- a/roles/os-horizon/tasks/main.yml +++ b/roles/os-horizon/tasks/main.yml @@ -15,6 +15,8 @@ - include: install.yml + - include: configure_horizon.yml + - name: Start horizon service: name={{ item }} enabled=yes state=started with_items: diff --git a/roles/os-horizon/templates/10_host.py.j2 b/roles/os-horizon/templates/10_host.py.j2 new file mode 100644 index 0000000..260c08e --- /dev/null +++ b/roles/os-horizon/templates/10_host.py.j2 @@ -0,0 +1,5 @@ +OPENSTACK_HOST = "{{ groups['openstack_identity'][0] }}" +OPENSTACK_KEYSTONE_URL = "{{keystone_protocol}}://%s:{{keystone_public_port}}/v3" % OPENSTACK_HOST +{% if keystone_ssl %} +OPENSTACK_SSL_NO_VERIFY = True +{% endif %}