devops--openstack--lab/vm-1.devstack/provision/openstack.sh

105 lines
2.3 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-12 23:02:17 +00:00
# sudo tee /etc/network/interfaces.d/openstack >/dev/null <<MARK
# # auto eth1
# # iface dummy0 inet manual
# # pre-up ip link add dummy0 type dummy
#
# auto br25
# iface br25 inet static
# address 172.16.0.2/16
# bridge_ports eth1
# bridge_stp off
# bridge_maxwait 0
# bridge_fd 0
# MARK
# 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
##
2023-04-12 23:04:34 +00:00
## Ref. https://docs.openstack.org/devstack/latest/guides/neutron.html
##
2023-04-04 06:51:02 +00:00
cat > local.conf <<-MARK
[[local|localrc]]
2023-04-12 22:54:43 +00:00
## Pull changes from upstream on next run on stack.sh
RECLONE=True
HOST_IP=192.168.56.21
SERVICE_HOST=192.168.56.21
MYSQL_HOST=192.168.56.21
RABBIT_HOST=192.168.56.21
GLANCE_HOSTPORT=192.168.56.21:9292
ADMIN_PASSWORD=adminsecret
DATABASE_PASSWORD=databasesecret
RABBIT_PASSWORD=rabbitsecret
SERVICE_PASSWORD=servicesecret
## Do not use Nova-Network
disable_service n-net
## Enable Neutron
ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,neutron
## Neutron options
Q_USE_SECGROUP=True
FLOATING_RANGE="192.168.56.0/24"
FIXED_RANGE="10.0.0.0/24"
Q_FLOATING_ALLOCATION_POOL=start=192.168.56.240,end=192.168.56.254
PUBLIC_NETWORK_GATEWAY="192.168.56.1"
2023-04-04 22:21:14 +00:00
PUBLIC_INTERFACE=eth1
2023-04-12 22:54:43 +00:00
## Open vSwitch provider networking configuration
Q_USE_PROVIDERNET_FOR_PUBLIC=True
OVS_PHYSICAL_BRIDGE=br-ex
PUBLIC_BRIDGE=br-ex
OVS_BRIDGE_MAPPINGS=public:br-ex
## Additionnal SM added
GIT_BASE=$(GIT_BASE:-https://opendev.org)
# FIXME: broken because of mysql
# enable_plugin tacker https://opendev.org/openstack/tacker master
## Enable heat plugin
ENABLED_SERVICES+=,h-eng,h-api,h-api-cfn,h-api-cw
enable_plugin heat https://opendev.org/openstack/heat master
## Disable tempest
disable_service tempest
## Enable mistral
enable_plugin mistral https://opendev.org/openstack/mistral
## Enable designate
## (buggy according to https://bugs.launchpad.net/designate/+bug/2036402)
# enable_plugin designate https://opendev.org/openstack/designate
2023-04-04 06:51:02 +00:00
MARK
##
## Run devstack
##
./stack.sh