From 23a9441efaffb3358885b1d42559dbf049aaad7e Mon Sep 17 00:00:00 2001 From: Oleksandr Martsyniuk Date: Tue, 25 Aug 2015 12:03:34 +0300 Subject: [PATCH] Plugin version bump. UI support for OpenContrail added. Change-Id: I466fd6f1299d4bbf2f6d2b322e8d3401da3c6024 --- .../puppet/manifests/site-common-pre.pp | 5 +++++ .../puppet/manifests/site-contrail-post1.pp | 4 +--- .../modules/contrail/manifests/database.pp | 6 +++--- .../puppet/modules/contrail/manifests/init.pp | 3 ++- .../contrail/templates/config.global.js.erb | 8 +++++++ environment_config.yaml | 21 ++++++++++++++----- install.sh | 15 ++++++++----- metadata.yaml | 4 ++-- 8 files changed, 47 insertions(+), 19 deletions(-) diff --git a/deployment_scripts/puppet/manifests/site-common-pre.pp b/deployment_scripts/puppet/manifests/site-common-pre.pp index 70bc7b220..e452ccfbe 100644 --- a/deployment_scripts/puppet/manifests/site-common-pre.pp +++ b/deployment_scripts/puppet/manifests/site-common-pre.pp @@ -38,5 +38,10 @@ case $operatingsystem yumrepo {'mos': priority => 1, exclude => 'python-thrift,nodejs'} # Contrail requires newer python-thrift and nodejs from it's repo package {'yum-plugin-priorities': ensure => present } } + Ubuntu: { + file { '/etc/apt/preferences.d/contrail-2.0.0.pref': + ensure => absent, + } + } default: {} } diff --git a/deployment_scripts/puppet/manifests/site-contrail-post1.pp b/deployment_scripts/puppet/manifests/site-contrail-post1.pp index e94eafedf..ab3170f54 100644 --- a/deployment_scripts/puppet/manifests/site-contrail-post1.pp +++ b/deployment_scripts/puppet/manifests/site-contrail-post1.pp @@ -27,9 +27,7 @@ if $contrail::node_name =~ /^contrail.\d+$/ { } $pkgs = ['python-crypto','python-netaddr','python-paramiko', 'ifenslave-2.6','patch','openjdk-7-jre-headless', - 'python-contrail','contrail-setup','contrail-utils','contrail-nodemgr','supervisor', - 'contrail-fabric-utils'] - $pip_pkgs = ['Fabric-1.7.5'] + 'python-contrail','contrail-setup','contrail-utils','contrail-nodemgr','supervisor'] } CentOS: { diff --git a/deployment_scripts/puppet/modules/contrail/manifests/database.pp b/deployment_scripts/puppet/modules/contrail/manifests/database.pp index 59ea63efb..fec8c9939 100644 --- a/deployment_scripts/puppet/modules/contrail/manifests/database.pp +++ b/deployment_scripts/puppet/modules/contrail/manifests/database.pp @@ -38,9 +38,9 @@ class contrail::database { content => template('contrail/zoo.cfg.erb'); } service { 'zookeeper': - ensure => running, - enable => true, - require => Package['zookeeper'], + ensure => running, + enable => true, + require => [Package['zookeeper'],Package['contrail-openstack-database']], subscribe => [File['/etc/zookeeper/conf/zoo.cfg'], File['/etc/zookeeper/conf/myid'], ], diff --git a/deployment_scripts/puppet/modules/contrail/manifests/init.pp b/deployment_scripts/puppet/modules/contrail/manifests/init.pp index e61311789..4ac2a0959 100644 --- a/deployment_scripts/puppet/modules/contrail/manifests/init.pp +++ b/deployment_scripts/puppet/modules/contrail/manifests/init.pp @@ -19,7 +19,8 @@ $settings = hiera('contrail') # TODO #$plugin_version = $settings['metadata']['plugin_version'] -$plugin_version = '1.0' +$plugin_version = '2.0' +$distribution=$settings['contrail_distribution'] $network_scheme = hiera('network_scheme') $uid = hiera('uid') diff --git a/deployment_scripts/puppet/modules/contrail/templates/config.global.js.erb b/deployment_scripts/puppet/modules/contrail/templates/config.global.js.erb index 109204507..4159682c8 100644 --- a/deployment_scripts/puppet/modules/contrail/templates/config.global.js.erb +++ b/deployment_scripts/puppet/modules/contrail/templates/config.global.js.erb @@ -228,11 +228,19 @@ config.redis_server_ip = '127.0.0.1'; config.redis_dump_file = '/var/lib/redis/dump-webui.rdb'; config.redis_password = ''; +<% if scope.lookupvar('contrail::distribution') == 'open' %> +/* Logo File: Use complete path of logo file location */ +config.logo_file = '/usr/src/contrail/contrail-web-core/webroot/img/opencontrail-logo.png'; + +/* Favicon File: Use complete path of favicon file location */ +config.favicon_file = '/usr/src/contrail/contrail-web-core/webroot/img/opencontrail-favicon.ico'; +<% else %> /* Logo File: Use complete path of logo file location */ config.logo_file = '/usr/src/contrail/contrail-web-core/webroot/img/juniper-networks-logo.png'; /* Favicon File: Use complete path of favicon file location */ config.favicon_file = '/usr/src/contrail/contrail-web-core/webroot/img/juniper-networks-favicon.ico'; +<% end %> config.featurePkg = {}; /* Add new feature Package Config details below */ diff --git a/environment_config.yaml b/environment_config.yaml index 24d5793e4..9d08f2aaf 100644 --- a/environment_config.yaml +++ b/environment_config.yaml @@ -4,11 +4,22 @@ attributes: restrictions: - condition: "not (cluster:net_provider == 'neutron' and networking_parameters:segmentation_type == 'gre')" message: "Please use Neutron with GRE segmentation, the only network type supported with Contrail plugin." + contrail_distribution: + type: "radio" + weight: 10 + value: "open" + label: "Contrail distribution" + description: "Select Contrail distribution" + values: + - data: "open" + label: "OpenContrail" + - data: "juniper" + label: "Juniper Contrail" contrail_asnum: value: '64512' label: 'AS Number' description: 'AS number for BGP communication' - weight: 10 + weight: 20 type: "text" regex: source: '^(?:(6553[0-5])|(655[0-2]\d)|(65[0-4]\d{2})|(6[0-4]\d{3})|([1-5]\d{4})|([1-9]\d{1,3})|([1-9]))$' @@ -16,17 +27,17 @@ attributes: contrail_private_gw: value: '' label: 'Gateway for Private network' - description: 'The IP address of gateway for contrail private network to reach BGP routers. Empty if not needed.' - weight: 40 + description: 'The IP address of gateway for contrail private network to reach BGP peers. Empty if not needed.' + weight: 30 type: "text" regex: source: '^((?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3})|(?:^)$' error: "Invalid IP address" contrail_gateways: - value: '10.109.3.254,10.110.1.1' + value: '10.109.3.250' label: 'GW IP' description: 'Comma separated IP addresses of BGP peers.' - weight: 50 + weight: 40 type: "text" regex: source: '^(?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3}(?:,\s*(?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3})*$' diff --git a/install.sh b/install.sh index 0744963b0..ca52fa8b0 100755 --- a/install.sh +++ b/install.sh @@ -27,7 +27,7 @@ set -ex -PLUGIN_PATH="/var/www/nailgun/plugins/contrail-1.0" +PLUGIN_PATH="/var/www/nailgun/plugins/contrail-2.0" UBUNTU_PKG=`find $PLUGIN_PATH -maxdepth 1 -name 'contrail-install-packages*.deb'` CENTOS_PKG=`find $PLUGIN_PATH -maxdepth 1 -name 'contrail-install-packages*.rpm'` @@ -35,16 +35,20 @@ yum -y install dpkg-devel createrepo if [ ! -f "$UBUNTU_PKG" ] && [ ! -f "$CENTOS_PKG" ]; then - echo "ERROR: No packages found at $PLUGIN_PATH" - exit 1 + echo "No Juniper Contrail packages found at $PLUGIN_PATH. Updating existing plugin repos." + cd $PLUGIN_PATH/repositories/ubuntu/ + dpkg-scanpackages ./ | gzip -c - > Packages.gz + cd $PLUGIN_PATH/repositories/centos/ + createrepo . fi if [ -f "$UBUNTU_PKG" ]; then DEB=`mktemp -d` dpkg -x $UBUNTU_PKG $DEB - tar -xzvf $DEB/opt/contrail/contrail_packages/contrail_debs.tgz -C $PLUGIN_PATH/repositories/ubuntu/ cd $PLUGIN_PATH/repositories/ubuntu/ + find . -type f -name "*.deb" -delete + tar -xzvf $DEB/opt/contrail/contrail_packages/contrail_debs.tgz -C $PLUGIN_PATH/repositories/ubuntu/ dpkg-scanpackages ./ | gzip -c - > Packages.gz fi @@ -54,8 +58,9 @@ if [ -f "$CENTOS_PKG" ]; cd $RPM rpm2cpio $CENTOS_PKG | cpio -id mkdir -p $PLUGIN_PATH/repositories/centos/Packages - tar -xzvf $RPM/opt/contrail/contrail_packages/contrail_rpms.tgz -C $PLUGIN_PATH/repositories/centos/Packages/ cd $PLUGIN_PATH/repositories/centos/ + find Packages -type f -name "*.rpm" -delete + tar -xzvf $RPM/opt/contrail/contrail_packages/contrail_rpms.tgz -C $PLUGIN_PATH/repositories/centos/Packages/ createrepo . fi diff --git a/metadata.yaml b/metadata.yaml index bca36bc81..ccb8e2390 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -3,7 +3,7 @@ name: contrail # Human-readable name for your plugin title: Fuel Contrail plugin # Plugin version -version: 1.0.1 +version: 2.0.0 # Description description: Contrail plugin for Fuel provides the functionality to add Juniper Contrail SDN for Mirantis OpenStack as network backend using Fuel Web UI in a user-friendly manner # Required fuel version @@ -25,6 +25,6 @@ releases: # Version of plugin package package_version: '2.0.0' licenses: ['Apache 2.0'] -authors: ['Vyacheslav Struk, Mirantis', 'Oleksandr Martsyniuk, Mirantis'] +authors: ['Mirantis Inc.'] homepage: https://github.com/stackforge/fuel-plugin-contrail groups: ['network']