daisy support Newton
Change-Id: I58556f898a02618a89c37a0e422b3db40a54f802 Signed-off-by: Yao Lu <lu.yao135@zte.com.cn>
This commit is contained in:
parent
34191588dd
commit
e170098f6f
|
@ -16,4 +16,4 @@ systemctl enable ntpd.service
|
|||
systemctl stop libvirtd.service
|
||||
systemctl disable libvirtd.service
|
||||
systemctl start ntpd.service
|
||||
yum -y install ansible1.9
|
||||
yum -y install ansible
|
||||
|
|
|
@ -41,7 +41,7 @@ from daisyclient import exc
|
|||
from keystoneclient.auth.identity import v2 as v2_auth
|
||||
from keystoneclient.auth.identity import v3 as v3_auth
|
||||
from keystoneclient import discover
|
||||
from keystoneclient.openstack.common.apiclient import exceptions as ks_exc
|
||||
from keystoneclient import exceptions as ks_exc
|
||||
from keystoneclient import session
|
||||
|
||||
osprofiler_profiler = importutils.try_import("osprofiler.profiler")
|
||||
|
|
|
@ -37,8 +37,8 @@ function yum_set
|
|||
make_yum_client
|
||||
echo "creating epel yum repo, please wait for several seconds..."
|
||||
yum install -y epel-release
|
||||
echo "creating openstack mitaka yum repo, please wait for several seconds..."
|
||||
yum install -y centos-release-openstack-mitaka
|
||||
echo "creating openstack newton yum repo, please wait for several seconds..."
|
||||
yum install -y centos-release-openstack-newton
|
||||
}
|
||||
|
||||
fi
|
||||
|
|
|
@ -80,7 +80,7 @@ function kolla_install
|
|||
systemctl stop libvirtd.service
|
||||
systemctl disable libvirtd.service
|
||||
systemctl start ntpd.service
|
||||
check_and_install_rpm ansible1.9
|
||||
check_and_install_rpm ansible
|
||||
check_and_install_rpm python2-crypto
|
||||
check_and_install_rpm python-gitdb
|
||||
check_and_install_rpm GitPython.noarch
|
||||
|
@ -103,19 +103,19 @@ function kolla_install
|
|||
cd /home/kolla_install
|
||||
git clone https://git.openstack.org/openstack/kolla
|
||||
cd kolla
|
||||
git checkout stable/mitaka
|
||||
git checkout stable/newton
|
||||
fi
|
||||
cp -r /home/kolla_install/kolla/etc/kolla /etc
|
||||
write_install_log "Begin copy images..."
|
||||
if [ -f "/home/kolla_install/docker/registry-mitaka-latest.tgz" ];then
|
||||
echo "registry-mitaka-latest.tgz already exist!"
|
||||
if [ -f "/home/kolla_install/docker/registry-3.0.0.tgz" ];then
|
||||
echo "registry-3.0.0.tgz already exist!"
|
||||
cd /home/kolla_install/docker
|
||||
tar mzxvf registry-mitaka-latest.tgz
|
||||
tar mzxvf registry-3.0.0.tgz
|
||||
else
|
||||
mkdir -p /home/kolla_install/docker
|
||||
cd /home/kolla_install/docker
|
||||
wget "ftp://openuser:123@120.76.145.166/registry-mitaka-latest.tgz"
|
||||
tar mzxvf registry-mitaka-latest.tgz
|
||||
wget "http://daisycloud.org/static/files/registry-3.0.0.tgz"
|
||||
tar mzxvf registry-3.0.0.tgz
|
||||
fi
|
||||
catalog=`curl $catalog_url |grep repositories`
|
||||
if [ -z $catalog ];then
|
||||
|
@ -123,7 +123,7 @@ function kolla_install
|
|||
echo "registry-server.tar already exist!"
|
||||
else
|
||||
cd /home/kolla_install/docker
|
||||
wget "ftp://openuser:123@120.76.145.166/registry-server.tar"
|
||||
wget "http://daisycloud.org/static/files/registry-server.tar"
|
||||
fi
|
||||
cd /home/kolla_install/docker
|
||||
docker load < ./registry-server.tar
|
||||
|
@ -709,12 +709,7 @@ function daisyrc_admin
|
|||
|
||||
if [ ! -e $file ];then
|
||||
touch $file
|
||||
echo "export OS_AUTH_TOKEN=admin" >> $file
|
||||
echo "export IRONIC_URL=http://$ip:6385/v1" >> $file
|
||||
echo "export OS_ENDPOINT=http://$ip:$bind_port" >> $file
|
||||
echo "export PS1='[\u@\h \W(daisy_admin)]\$ '" >> $file
|
||||
echo "export OS_SERVICE_TOKEN=e93e9abf42f84be48e0996e5bd44f096" >> $file
|
||||
echo "export OS_SERVICE_ENDPOINT=http://$ip:35357/v2.0" >> $file
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -785,10 +780,9 @@ function build_pxe_server
|
|||
fi
|
||||
}
|
||||
|
||||
function config_keystone_local_setting
|
||||
function config_dashboard_local_setting
|
||||
{
|
||||
local dashboard_conf_file="/etc/openstack-dashboard/local_settings"
|
||||
local keystone_conf_file="/etc/keystone/keystone.conf"
|
||||
|
||||
get_public_ip
|
||||
if [ -z $public_ip ];then
|
||||
|
@ -796,15 +790,13 @@ function config_keystone_local_setting
|
|||
exit 1
|
||||
fi
|
||||
|
||||
update_config "$dashboard_conf_file" OPENSTACK_KEYSTONE_URL "\"http://${public_ip}:5000/v2.0\""
|
||||
update_config "$dashboard_conf_file" OPENSTACK_KEYSTONE_URL "\"http://${public_ip}:5000/v3\""
|
||||
update_config "$dashboard_conf_file" DAISY_ENDPOINT_URL "\"http://$public_ip:19292\""
|
||||
update_config "$dashboard_conf_file" WEBROOT "'/dashboard/'"
|
||||
update_config "$dashboard_conf_file" LOGIN_URL "'/dashboard/auth/login/'"
|
||||
update_config "$dashboard_conf_file" LOGOUT_URL "'/dashboard/auth/logout/'"
|
||||
update_config "$dashboard_conf_file" ALLOWED_HOSTS "['*']"
|
||||
update_config "$dashboard_conf_file" AUTHENTICATION_URLS "['openstack_auth.urls',]"
|
||||
openstack-config --set "$keystone_conf_file" DEFAULT admin_token "e93e9abf42f84be48e0996e5bd44f096"
|
||||
openstack-config --set "$keystone_conf_file" token expiration "90000"
|
||||
|
||||
touch /var/log/horizon/horizon.log
|
||||
chown apache:apache /var/log/horizon/horizon.log
|
||||
|
@ -821,6 +813,14 @@ function config_keystone_local_setting
|
|||
fi
|
||||
}
|
||||
|
||||
function config_keystone_local_setting
|
||||
{
|
||||
local keystone_conf_file="/etc/keystone/keystone.conf"
|
||||
openstack-config --set "$keystone_conf_file" database connection "mysql+pymysql://keystone:keystone@127.0.0.1/keystone"
|
||||
openstack-config --set "$keystone_conf_file" token provider "fernet"
|
||||
openstack-config --set "$keystone_conf_file" token expiration "90000"
|
||||
}
|
||||
|
||||
function config_get_node_info
|
||||
{
|
||||
local get_node_info_file="/var/lib/daisy/kolla/getnodeinfo.sh"
|
||||
|
|
|
@ -94,11 +94,11 @@ function all_install
|
|||
exit 1
|
||||
else
|
||||
update_section_config "$daisy_file" database connection "mysql://daisy:daisy@$public_ip/$db_name?charset=utf8"
|
||||
config_dashboard_local_setting
|
||||
config_keystone_local_setting
|
||||
fi
|
||||
|
||||
systemctl restart openstack-keystone.service
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:systemctl restart openstack-keystone.service failed"; exit 1; }
|
||||
ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
|
||||
systemctl restart httpd.service
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:systemctl restart httpd.service failed"; exit 1; }
|
||||
systemctl start daisy-api.service
|
||||
|
@ -108,7 +108,6 @@ function all_install
|
|||
systemctl start mariadb.service
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:systemctl start mariadb.service failed"; exit 1; }
|
||||
|
||||
systemctl enable openstack-keystone.service >> $install_logfile 2>&1
|
||||
systemctl enable httpd.service >> $install_logfile 2>&1
|
||||
systemctl enable daisy-api.service >> $install_logfile 2>&1
|
||||
systemctl enable daisy-registry.service >> $install_logfile 2>&1
|
||||
|
@ -180,28 +179,21 @@ function all_install
|
|||
write_install_log "start keystone-manage db_sync..."
|
||||
keystone-manage db_sync
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:keystone-manage db_sync command failed"; exit 1; }
|
||||
write_install_log "start keystone-manage fernet_setup..."
|
||||
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:keystone-manage fernet_setup command failed"; exit 1; }
|
||||
write_install_log "start keystone-manage credential_setup..."
|
||||
keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:keystone-manage credential_setup command failed"; exit 1; }
|
||||
write_install_log "start keystone-manage bootstrap..."
|
||||
keystone-manage bootstrap --bootstrap-password $keystone_admin_token \
|
||||
--bootstrap-admin-url http://127.0.0.1:35357/v3/ \
|
||||
--bootstrap-internal-url http://127.0.0.1:35357/v3/ \
|
||||
--bootstrap-public-url http://127.0.0.1:5000/v3/ \
|
||||
--bootstrap-region-id RegionOne
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:keystone-manage bootstrap command failed"; exit 1; }
|
||||
fi
|
||||
#creat horizon admin account
|
||||
export OS_SERVICE_TOKEN=$keystone_admin_token
|
||||
export OS_SERVICE_ENDPOINT=http://$public_ip:35357/v2.0
|
||||
keystone user-create --name=admin --pass=keystone >> $install_logfile 2>&1
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:keystone user-create command failed"; exit 1; }
|
||||
keystone role-create --name=admin >> $install_logfile 2>&1
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:keystone role-create command failed"; exit 1; }
|
||||
keystone tenant-create --name=admin --description="Admin Tenant" >> $install_logfile 2>&1
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:keystone tenant-create command failed"; exit 1; }
|
||||
keystone user-role-add --user=admin --tenant=admin --role=admin >> $install_logfile 2>&1
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:keystone user-role-add command failed"; exit 1; }
|
||||
#keystone user-role-add --user=admin --role=_member_ --tenant=admin >> $install_logfile 2>&1
|
||||
keystone service-create --name keystone --type identity --description "OpenStack Identity Service" >> $install_logfile 2>&1
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:keystone service-create command failed"; exit 1; }
|
||||
service_id=`keystone service-list 2>/dev/null|grep "keystone" |awk -F '| ' '{print $2}'`
|
||||
if [ -z $service_id ];then
|
||||
write_install_log "Error:there is no service in keystone database"
|
||||
exit 1
|
||||
fi
|
||||
keystone endpoint-create --service-id=$service_id --region=RegionOne --publicurl=http://$public_ip:5000/v2.0 --internalurl=http://$public_ip:5000/v2.0 --adminurl=http://$public_ip:35357/v2.0 >> $install_logfile 2>&1
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:keystone endpoint-create command failed"; exit 1; }
|
||||
|
||||
#creat daisy datebase tables
|
||||
which daisy-manage >> $install_logfile 2>&1
|
||||
if [ "$?" == 0 ];then
|
||||
|
@ -225,9 +217,6 @@ function all_install
|
|||
systemctl restart rabbitmq-server.service
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:systemctl restart rabbitmq-server.service failed"; exit 1; }
|
||||
|
||||
systemctl restart openstack-keystone.service
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:systemctl restart rabbitmq-server.service failed"; exit 1; }
|
||||
|
||||
systemctl restart openstack-ironic-discoverd.service
|
||||
[ "$?" -ne 0 ] && { write_install_log "Error:systemctl restart openstack-ironic-discoverd.service failed"; exit 1; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue