1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| #!/bin/bash echo -e "输入虚拟机网卡名称(名称格式ens32 eth0)" read netinterface hostnamectl set-hostname openstack curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo yum clean all yum makecache yum update -y systemctl stop NetworkManager systemctl disable NetworkManager setenforce 0 echo SELINUX=disabled > /etc/selinux/config echo SELINUXTYPE=targeted >> /etc/selinux/config systemctl stop firewalld systemctl disable firewalld yum install https://rdoproject.org/repos/rdo-release.rpm -y #如需安装OpenStack Train版本,把上一行替换为yum -y install centos-release-openstack-train yum install -y openstack-packstack packstack --gen-answer-file /root/openstack-answer.txt sed -i 's/^CONFIG_NEUTRON_OVN_BRIDGE_IFACES=.*\.*/CONFIG_NEUTRON_OVN_BRIDGE_IFACES=br-ex:'$netinterface'/' /root/openstack-answer.txt packstack --answer-file /root/openstack-answer.txt
|