当前位置: 代码迷 >> 综合 >> OpenStack Horizon服务安装脚本
  详细解决方案

OpenStack Horizon服务安装脚本

热度:5   发布时间:2023-12-09 03:47:10.0

Controller

#!/bin/shinstall_horizon(){
    #报错即刻退出set -o errexitset -xecho "---------------Horizon安装和配置------------------"(echo 'y')|apt install openstack-dashboardsed -i "39s/^#ALLOWED_HOSTS\s.*/ALLOWED_HOSTS=['controller', 'localhost']/"  /etc/openstack-dashboard/local_settings.pyhead -n 39 /etc/openstack-dashboard/local_settings.py | tail -n 1sed -i "65s/^#OPENSTACK_API_VERSIONS\s.*/OPENSTACK_API_VERSIONS = {/"  /etc/openstack-dashboard/local_settings.pyhead -n 65 /etc/openstack-dashboard/local_settings.py | tail -n 1sed -i "67s/^#//"  /etc/openstack-dashboard/local_settings.pyhead -n 67 /etc/openstack-dashboard/local_settings.py | tail -n 1sed -i "68s/^#//"  /etc/openstack-dashboard/local_settings.pyhead -n 68 /etc/openstack-dashboard/local_settings.py | tail -n 1sed -i "69s/^#//"  /etc/openstack-dashboard/local_settings.pyhead -n 69 /etc/openstack-dashboard/local_settings.py | tail -n 1sed -i "71s/^#//" /etc/openstack-dashboard/local_settings.pyhead -n 71 /etc/openstack-dashboard/local_settings.py | tail -n 1sed -i "76s/^#OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT\s.*/OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True/"  /etc/openstack-dashboard/local_settings.py	head -n 76 /etc/openstack-dashboard/local_settings.py | tail -n 1sed -i "98s/^#OPENSTACK_KEYSTONE_DEFAULT_DOMAIN\s.*/OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = \"Default\"/"  /etc/openstack-dashboard/local_settings.pyhead -n 98 /etc/openstack-dashboard/local_settings.py | tail -n 1sed -i "186s/^OPENSTACK_HOST\s.*/OPENSTACK_HOST = \"controller\"/"  /etc/openstack-dashboard/local_settings.pyhead -n 186 /etc/openstack-dashboard/local_settings.py | tail -n 1		#修改DEFAULT_ROLE若有问题将此行去掉sed -i "188s/^OPENSTACK_KEYSTONE_DEFAULT_ROLE\s.*/OPENSTACK_KEYSTONE_DEFAULT_ROLE = \"user\"/"  /etc/openstack-dashboard/local_settings.pyhead -n 188 /etc/openstack-dashboard/local_settings.py | tail -n 1#163sed -i "159s/127.0.0.1/controller/"  /etc/openstack-dashboard/local_settings.pyhead -n 159 /etc/openstack-dashboard/local_settings.py | tail -n 1sed -i "155i SESSION_ENGINE = \'django.contrib.sessions.backends.cache\'" /etc/openstack-dashboard/local_settings.pyhead -n 155 /etc/openstack-dashboard/local_settings.py | tail -n 1/etc/init.d/apache2 restart
}install_horizon

参考

Installation Guide