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

104 lines
2.2 KiB
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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
enable_plugin designate https://opendev.org/openstack/designate
MARK
##
## Run devstack
##
./stack.sh