devops--openstack--lab/vagrant--devstack/provision/openstack.sh

60 lines
1 KiB
Bash
Raw Normal View History

2023-04-04 06:51:02 +00:00
#!/bin/sh
# useradd -s /bin/bash -d /opt/stack -m stack
# chmod +x /opt/stack
# apt-get install sudo -y
# echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
##
## Install prerequisites
##
2023-04-04 22:54:07 +00:00
sudo apt-get install -y git bridge-utils
2023-04-04 06:51:02 +00:00
2023-04-04 22:21:14 +00:00
##
## Create network
##
2023-04-04 22:23:10 +00:00
sudo tee /etc/network/interfaces.d/openstack >/dev/null <<MARK
2023-04-04 22:21:14 +00:00
# auto eth1
# iface dummy0 inet manual
# pre-up ip link add dummy0 type dummy
auto br25
iface br25 inet static
2023-04-04 22:55:46 +00:00
address 172.16.0.2/16
2023-04-04 22:21:14 +00:00
bridge_ports eth1
bridge_stp off
bridge_maxwait 0
bridge_fd 0
MARK
2023-04-04 22:39:26 +00:00
sudo ifup br25
2023-04-04 22:21:14 +00:00
2023-04-04 06:51:02 +00:00
##
## Get openstack
##
git clone https://opendev.org/openstack/devstack
cd devstack || exit 1
##
## Create configuration
##
cat > local.conf <<-MARK
[[local|localrc]]
2023-04-04 22:21:14 +00:00
HOST_IP=172.16.0.1
FLAT_INTERFACE=br25
PUBLIC_INTERFACE=eth1
FLOATING_RANGE=172.16.0.128/25
2023-04-04 06:51:02 +00:00
FIXED_RANGE=10.11.12.0/24
2023-04-04 22:21:14 +00:00
2023-04-04 06:51:02 +00:00
ADMIN_PASSWORD=admin1pass
DATABASE_PASSWORD=database2pass
RABBIT_PASSWORD=rabbit3pass
SERVICE_PASSWORD=service4pass
MARK
##
## Run devstack
##
./stack.sh