From fae23b989022b69dbf39eb2929ba548d55ef3804 Mon Sep 17 00:00:00 2001 From: Michal Skalski Date: Thu, 10 Dec 2015 11:04:36 +0100 Subject: [PATCH] import code Change-Id: Ia1df8d96ce69941f739c40aae557f82b58d9c026 --- README.md | 75 +++++++++++++++++++ .../puppet/manifests/install-bgpvpn.pp | 6 ++ deployment_tasks.yaml | 9 +++ environment_config.yaml | 6 ++ metadata.yaml | 30 ++++++++ pre_build_hook | 54 +++++++++++++ repositories/centos/.gitkeep | 0 repositories/ubuntu/.gitkeep | 0 8 files changed, 180 insertions(+) create mode 100644 README.md create mode 100644 deployment_scripts/puppet/manifests/install-bgpvpn.pp create mode 100644 deployment_tasks.yaml create mode 100644 environment_config.yaml create mode 100644 metadata.yaml create mode 100755 pre_build_hook create mode 100644 repositories/centos/.gitkeep create mode 100644 repositories/ubuntu/.gitkeep diff --git a/README.md b/README.md new file mode 100644 index 0000000..ebf579a --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +BGPVPN Plugin for Fuel +================================ + +BGPVPN plugin +----------------------- + +Overview +-------- + +BGPVPN fuel plugin. + +Requirements +------------ + +| Requirement | Version/Comment | +|----------------------------------|-----------------| +| Mirantis OpenStack compatibility | 7.0 | + +Recommendations +--------------- + +None. + +Limitations +----------- + +Installation Guide +================== + +OpenDaylight plugin installation +---------------------------------------- + +1. Clone the fuel-plugin-bgpvpn repo from github: + + git clone https://github.com/openstack/fuel-plugin-bgpvpn + +2. Install the Fuel Plugin Builder: + + pip install fuel-plugin-builder + +3. Install the [fpm gem](https://github.com/jordansissel/fpm): + + gem install fpm + +4. Build bgpvpn Fuel plugin: + + fpb --build fuel-plugin-bgpvpn/ + +5. The *bgpvpn-[x.x.x].rpm* plugin package will be created in the plugin folder. + +6. Move this file to the Fuel Master node with secure copy (scp): + + scp bgpnvpn-[x.x.x].rpm root@:/tmp + +7. While logged in Fuel Master install the OpenDaylight plugin: + + fuel plugins --install bgpvpn-[x.x.x].rpm + +8. Check if the plugin was installed successfully: + + fuel plugins + + id | name | version | package_version + ---|--------------|---------|---------------- + 1 | bgpvpn | 0.1.0 | 3.0.0 + +9. Plugin is ready to use and can be enabled on the Settings tab of the Fuel web UI. + + +User Guide +========== + +Contributors +------------ + diff --git a/deployment_scripts/puppet/manifests/install-bgpvpn.pp b/deployment_scripts/puppet/manifests/install-bgpvpn.pp new file mode 100644 index 0000000..3e3625b --- /dev/null +++ b/deployment_scripts/puppet/manifests/install-bgpvpn.pp @@ -0,0 +1,6 @@ +package {'python-networking-bgpvpn': + ensure => installed, +} -> +neutron_config { 'DEFAULT/service_plugins': value => 'networking_bgpvpn.neutron.services.plugin.BGPVPNPlugin';} + + diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml new file mode 100644 index 0000000..c38e88b --- /dev/null +++ b/deployment_tasks.yaml @@ -0,0 +1,9 @@ +- id: bgpvpn_configure + role: ['primary-controller', 'controller'] + requires: [post_deployment_start] + required_for: [post_deployment_end] + type: puppet + parameters: + puppet_manifest: puppet/manifests/install-bgpvpn.pp + puppet_modules: puppet/modules:/etc/puppet/modules + timeout: 1400 diff --git a/environment_config.yaml b/environment_config.yaml new file mode 100644 index 0000000..26ec881 --- /dev/null +++ b/environment_config.yaml @@ -0,0 +1,6 @@ +attributes: + metadata: + restrictions: + - "cluster:net_provider != 'neutron'": "Only neutron is supported by OpenDaylight" + label: "BGPVPN plugin" + weight: 90 diff --git a/metadata.yaml b/metadata.yaml new file mode 100644 index 0000000..5503d88 --- /dev/null +++ b/metadata.yaml @@ -0,0 +1,30 @@ +# Plugin name +name: bgpvpn +# Human-readable name for your plugin +title: BGPVPN plugin +# Plugin version +version: '0.1.0' +# Description +description: 'This plugin provides BGPVPN extension for neutron.' +# Required fuel version +fuel_version: ['7.0'] +# Specify license of your plugin +licenses: ['Apache License Version 2.0'] +# Specify author or company name +authors: ['Michal Skalski, Mirantis'] +# A link to the plugin's page +homepage: 'https://github.com/openstack/fuel-plugin-bgpvpn' +# Specify a group which your plugin implements, possible options: +# network, storage, storage::cinder, storage::glance, hypervisor +groups: ['network'] + +# The plugin is compatible with releases in the list +releases: + - os: ubuntu + version: 2015.1.0-7.0 + mode: ['ha', 'multinode'] + deployment_scripts_path: deployment_scripts/ + repository_path: repositories/ubuntu + +# Version of plugin package +package_version: '3.0.0' diff --git a/pre_build_hook b/pre_build_hook new file mode 100755 index 0000000..10b5bfb --- /dev/null +++ b/pre_build_hook @@ -0,0 +1,54 @@ +#!/bin/bash + +# Add here any the actions which are required before plugin build +# like packages building, packages downloading from mirrors and so on. +# The script should return 0 if there were no errors. +set -eux + +# Networking bgpvpn +NETWORKING_BGPVPN_REPO=${NETWORKING_BGPVPN_REPO:-https://github.com/openstack/networking-bgpvpn.git} +NETWORKING_BGPVPN_BRANCH=${NETWORKING_BGPVPN_BRANCH:-backport/kilo} + +# For which systems odl package should be build +BUILD_FOR=${BUILD_FOR:-ubuntu} + +DIR="$(dirname `readlink -f $0`)" +TMP_DIR="${DIR}/tmp" + +function cleanup { + rm -rf "${TMP_DIR}" +} + +function build_pkg { + case $1 in + ubuntu) + pushd "${DIR}/repositories/${1}/" + fpm --force -s python -t deb -m 'mskalski@mirantis.com' --python-disable-dependency oslo.config ${TMP_DIR}/networking-bgpvpn/setup.py + popd + ;; + *) echo "Not supported system"; exit 1;; + esac +} + +command -v fpm >/dev/null 2>&1 || { echo >&2 "fpm ruby gem required but it's not installed. Aborting."; exit 1; } + +cleanup + +mkdir -p "${TMP_DIR}" + +pushd $TMP_DIR + + +git clone $NETWORKING_BGPVPN_REPO networking-bgpvpn +pushd networking-bgpvpn +git checkout $NETWORKING_BGPVPN_BRANCH +sed -i -- 's/sphinxcontrib-blockdiag/sphinxcontrib.blockdiag/' ./requirements.txt +sed -i -- 's/sphinxcontrib-seqdiag/sphinxcontrib.seqdiag/' ./requirements.txt +popd + +for system in $BUILD_FOR +do + build_pkg $system +done + +cleanup diff --git a/repositories/centos/.gitkeep b/repositories/centos/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/repositories/ubuntu/.gitkeep b/repositories/ubuntu/.gitkeep new file mode 100644 index 0000000..e69de29