Skip to content

Instantly share code, notes, and snippets.

@fnaval
Last active September 14, 2015 22:01
Show Gist options
  • Save fnaval/ea396b405fd6447568c8 to your computer and use it in GitHub Desktop.
Save fnaval/ea396b405fd6447568c8 to your computer and use it in GitHub Desktop.
20150907 working setup devstack script
#!/bin/bash
#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
#pushd /tmp/devstack
#popd
cat > /tmp/devstack/localrc <<EOF
#enable_plugin barbican https://git.openstack.org/openstack/barbican master

enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas master
enable_plugin octavia https://git.openstack.org/openstack/octavia master
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
KEYSTONE_TOKEN_FORMAT=UUID
# Pre-requisite
#ENABLED_SERVICES=rabbit,mysql,key,barbican
# see /opt/stack/barbican/contrib/devstack/lib
ENABLED_SERVICES=rabbit,mysql,key,barbican-svc,barbican-retry
# 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
IMAGE_URLS+=",https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-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,q-lbaasv2,octavia,o-api,o-cw,o-hk,o-hm
#ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron,q-lbaasv2
LIBS_FROM_GIT=python-neutronclient
# Cinder
ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch
# Tempest
ENABLED_SERVICES+=,tempest
EOF
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/
rm -rf /tmp/barbican/
# Configure Tempest
# cp /tmp/barbican/etc/dev_tempest.conf /etc/tempest.conf
# Create the stack user
/tmp/devstack/tools/create-stack-user.sh
# Move everything into place
mv /tmp/devstack /opt/stack/
# see https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/867806
adduser stack lightdm
#rm -rf /tmp/barbican/
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
# Set up test requirements
pip install tox
# 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 -p /etc/tempest
cp /opt/stack/tempest/etc/tempest.conf /etc/tempest/
# Run Barbican functional tests
# su - stack -c "cd /opt/stack/barbican/ && tox -e functional"
# Run Neutron-LBaaS scenario tests
# su - stack -c "cd /opt/stack/neutron-lbaas/ && tox -e scenario"
# Drop into a shell
su - stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment