Update Devstack deployment and docs

Move the devstack files inside Barbican tree. Also updates
the devstack documentation for installing barbican via
vagrant or manually.

Closes-bug: #1499112
Change-Id: Ifd09aa3c120033f4043d1a0c106a5ea653ee3c68
This commit is contained in:
Christopher Solis 2015-10-02 00:28:15 -05:00 committed by Chris Solis
parent 7dc704e132
commit e171dcdca2
3 changed files with 97 additions and 42 deletions

24
devstack/barbican-vagrant/Vagrantfile vendored Normal file
View File

@ -0,0 +1,24 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
# Barbican Ports
config.vm.network "forwarded_port", guest: 9311, host: 9311
# Keystone Ports
config.vm.network "forwarded_port", guest: 35357, host: 35357
config.vm.network "forwarded_port", guest: 5000, host: 5000
config.vm.provision "shell", path: "install_devstack.sh"
config.vm.synced_folder "./devstack", "/opt/stack", create: true
config.vm.provider "virtualbox" do |v|
v.name = "Devstack"
v.memory = 2048
v.cpus = 2
end
end

View File

@ -0,0 +1,15 @@
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y python-pip python-dev libffi-dev libssl-dev git
git clone https://github.com/openstack-dev/devstack.git
git clone https://github.com/openstack/barbican.git
cp barbican/devstack/local.conf.example devstack/local.conf
sudo cp -R devstack/ /opt/stack/
sudo chown -R vagrant:vagrant /opt/stack/
echo "export SERVICE_HOST=\"localhost\"" >> .bashrc

View File

@ -1,14 +1,16 @@
Running Barbican on DevStack Running Barbican on DevStack
=================================== ============================
Currently, Barbican is not available within the default DevStack installation. Barbican is currently available via the plugin interface within devstack
However, you can patch a DevStack installation to include Barbican in the
manual setup process below.
It is suggested that you install DevStack into an empty VM due to the number We provide two ways of deploying a DevStack environment with a running
of dependencies installed and configuration that is performed. With this in Barbican. The easy mode uses vagrant and automatically creates the VM
mind, we provide an easy way of running Barbican on DevStack within a Vagrant with all necessary dependencies to run DevStack. It is recommended to use
VM. this process if it is your first time.
If you are familiar with DevStack you can use the steps in the manual
setup section to install Barbican onto your already running DevStack
installation.
.. warning:: .. warning::
@ -17,43 +19,53 @@ VM.
Easy Mode Easy Mode
------------ ---------
To simplify the setup process of running Barbican on DevStack, there is a To simplify the setup process of running Barbican on DevStack, there is a
Vagrantfile that will automatically setup up a VM containing Barbican Vagrantfile that will automatically setup up a VM containing Barbican
running on Devstack. running on Devstack.
1. Clone the Vagrantfile collection 1. Obtain Barbican vagrant file
If you don't already have the file then clone the repo below
.. code-block:: bash .. code-block:: bash
git clone https://github.com/cloudkeep/vagrantfile-collection.git git clone https://github.com/openstack/barbican.git
2. Move the ``barbican-vagrant`` directory outside of the Barbican directory
and into your current directory for vagrant files. If you do not have one,
then just copy it into your home directory.
2. Get into the ``barbican-devstack`` directory
.. code-block:: bash .. code-block:: bash
cd vagrantfile-collection/barbican-devstack cp -r barbican/devstack/barbican-vagrant <directory>
3. Start create a new VM based on the cloned configuration 3. Get into the ``barbican-vagrant`` directory
.. code-block:: bash
cd barbican-vagrant
4. Start create a new VM based on the cloned configuration
.. code-block:: bash .. code-block:: bash
vagrant up vagrant up
4. Once the VM has been successfully started and provisioned, ssh into the VM. 5. Once the VM has been successfully started and provisioned, ssh into the VM.
.. code-block:: bash .. code-block:: bash
vagrant ssh vagrant ssh
5. Once inside the VM, change your directory to the ``devstack`` folder. 6. Once inside the VM, change your directory to the ``devstack`` folder.
.. code-block:: bash .. code-block:: bash
cd /opt/stack/devstack/ cd /opt/stack/devstack/
6. Start DevStack 7. Start DevStack
.. code-block:: bash .. code-block:: bash
@ -61,7 +73,7 @@ running on Devstack.
Manual Setup Manual Setup
--------------- ------------
These steps assume you are running within a clean Ubuntu 14.04 virtual These steps assume you are running within a clean Ubuntu 14.04 virtual
machine (local or cloud instance). If you are running locally, do not forget machine (local or cloud instance). If you are running locally, do not forget
@ -72,36 +84,40 @@ to expose the following ports
#. Keystone Admin API - ``35357`` #. Keystone Admin API - ``35357``
Installation Installation
^^^^^^^^^^^^^ ^^^^^^^^^^^^
.. code-block:: bash 1. Make sure you are logged in as a non-root user with sudo privileges
# Install system dependencies to start DevStack and install Barbican 2. Install git
sudo apt-get update
sudo apt-get install -y python-pip python-dev libffi-dev libssl-dev git \
libldap2-dev libsasl2-dev
# Clone DevStack and Barbican .. code-block:: bash
git clone https://git.openstack.org/cgit/openstack-dev/devstack.git
git clone https://github.com/openstack/barbican.git
# Patch DevStack with Barbican setup files sudo apt-get install git
cp barbican/contrib/devstack/lib/barbican devstack/lib/
cp barbican/contrib/devstack/local.conf devstack/
cp barbican/contrib/devstack/extras.d/70-barbican.sh devstack/extras.d/
# Copy to setup directory 3. Clone DevStack
sudo cp -R devstack/ /opt/stack/
# Create a non-root user for DevStack .. code-block:: bash
sudo ./devstack/tools/create-stack-user.sh
# Assign permissions to that user git clone https://github.com/openstack-dev/devstack.git
sudo chown -R stack:stack /opt/stack/
# Set the service host to localhost (Only for Local VMs) 4. Add the Barbican plugin to the local.conf file and verify the minimum
sudo su - stack -c "echo \"export SERVICE_HOST=\\\"localhost\\\"\" >> .bashrc" services required are included. You can pull down a specific branch by
appending the name to the end of the git url. If you leave the space empty
like below, then origin/master will be pulled.
# Start DevStack .. code-block:: ini
cd /opt/stack/devstack/
./stack.sh enable_plugin barbican https://git.openstack.org/openstack/barbican
enable_service rabbit mysql key
If this is your first time and you do not have a local.conf file, there is
an example in the `Barbican github
<https://github.com/openstack/barbican/tree/master/devstack>`_.
Copy the file and place it in the devstack/ directory.
5. Start DevStack
.. code-block:: bash
cd devstack/
./stack.sh