Skip to content

Instantly share code, notes, and snippets.

@banveerad
Forked from rm-you/devstack-setup.sh
Last active January 22, 2016 19:16
Show Gist options
  • Save banveerad/8d3927ce19225ef6ef79 to your computer and use it in GitHub Desktop.
Save banveerad/8d3927ce19225ef6ef79 to your computer and use it in GitHub Desktop.
Devstack setup script for Neutron-LBaaS + Barbican + Octavia
#!/bin/bash
# Original author https://gist.github.com/rm-you
# Set up the packages we need
apt-get update
apt-get install libffi-dev libssl-dev git vim libxml2-dev libsqlite3-dev libxslt1-dev -y
# Clone the repos we need
git clone https://github.com/openstack/barbican.git /tmp/barbican
git clone https://github.com/openstack-dev/devstack.git /tmp/devstack
cp -r /tmp/barbican/contrib/devstack/lib/barbican /tmp/devstack/lib/
cp /tmp/barbican/contrib/devstack/extras.d/70-barbican.sh /tmp/devstack/extras.d/
cat <<EOF > /tmp/devstack/localrc
enable_plugin neutron-lbaas https://review.openstack.org/openstack/neutron-lbaas
enable_plugin octavia https://review.openstack.org/openstack/octavia
LIBS_FROM_GIT+=python-neutronclient
USE_CONSTRAINTS=True
DATABASE_PASSWORD=password
ADMIN_PASSWORD=password
SERVICE_PASSWORD=password
SERVICE_TOKEN=password
RABBIT_PASSWORD=password
# Enable Logging
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs
# Pre-requisite
ENABLED_SERVICES=rabbit,mysql,key
# Horizon (always use the trunk)
ENABLED_SERVICES+=,horizon
HORIZON_REPO=https://github.com/openstack/horizon
HORIZON_BRANCH=master
# Nova
ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-cauth
IMAGE_URLS+=",http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img"
# Glance
ENABLED_SERVICES+=,g-api,g-reg
# Neutron
ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron
# Enable LBaaS V2
ENABLED_SERVICES+=,q-lbaasv2
# Cinder
ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch
# Tempest
ENABLED_SERVICES+=,tempest
# Barbican
ENABLED_SERVICES+=,barbican
# Octavia
ENABLED_SERVICES+=,octavia,o-api,o-cw,o-hk,o-hm
EOF
# Create the stack user
/tmp/devstack/tools/create-stack-user.sh
# Move everything into place
mv /tmp/devstack /opt/stack/
rm -rf /tmp/barbican/
git clone https://github.com/openstack/requirements.git /opt/stack/requirements
chown -R stack:stack /opt/stack/devstack/
# Fix permissions on current tty so screens can attach
chmod go+rw `tty`
# Let's rock
su - stack -c /opt/stack/devstack/stack.sh
# Add environment variables for auth/endpoints
echo 'export OS_TENANT_NAME=admin' >> /opt/stack/.bashrc
echo 'export OS_USERNAME=admin' >> /opt/stack/.bashrc
echo 'export OS_PASSWORD=password' >> /opt/stack/.bashrc
echo 'export OS_AUTH_URL="http://localhost:5000/v2.0/"' >> /opt/stack/.bashrc
echo 'export BARBICAN_ENDPOINT="http://localhost:9311/"' >> /opt/stack/.bashrc
echo 'export OS_IDENTITY_API_VERSION="2.0"' >> /opt/stack/.bashrc
# Set up tempest config
mkdir /etc/tempest
cp /opt/stack/tempest/etc/tempest.conf /etc/tempest/
# Drop into a shell
su - stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment