summaryrefslogtreecommitdiff
path: root/docker/horizon/start.sh
blob: d51cac6551e03b8271d417970f15885ec155d38a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -e

: ${HORIZON_KEYSTONE_USER:=horizon}

. /opt/kolla/kolla-common.sh

check_required_vars HORIZON_KEYSTONE_USER

check_for_keystone
check_for_glance
check_for_nova
check_for_neutron

cfg=/etc/openstack-dashboard/local_settings

sed -ri 's/#ALLOWED_HOSTS = \['\''horizon.example.com'\'', '\''localhost'\''\]/ALLOWED_HOSTS = \['\''*'\'', \]/' /etc/openstack-dashboard/local_settings

sed -ri 's/OPENSTACK_KEYSTONE_URL = \"http:\/\/%s:5000\/v2.0\" % OPENSTACK_HOST/OPENSTACK_KEYSTONE_URL = \"http:\/\/'"$KEYSTONE_PUBLIC_SERVICE_HOST"':5000\/v2.0\"/' /etc/openstack-dashboard/local_settings

sed -ri 's/OPENSTACK_HOST = \"127.0.0.1\"/OPENSTACK_HOST = \"'"$KEYSTONE_PUBLIC_SERVICE_HOST"'\" /' /etc/openstack-dashboard/local_settings

/bin/keystone role-create --name ${HORIZON_KEYSTONE_USER}