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

105 lines
2.3 KiB
Bash
Raw Permalink Normal View History

2024-07-16 11:37:55 +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
##
sudo apt-get install -y git bridge-utils
##
## Create network
##
# 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
##
## Get openstack
##
git clone https://opendev.org/openstack/devstack
cd devstack || exit 1
##
## Create configuration
##
## Ref. https://docs.openstack.org/devstack/latest/guides/neutron.html
##
cat > local.conf <<-MARK
[[local|localrc]]
## 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"
PUBLIC_INTERFACE=eth1
## 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
MARK
##
## Run devstack
##
./stack.sh