Easier way to define karaf features

Change-Id: I65b341b265638d80fbacdf550f9a92b42def8c95
This commit is contained in:
Michal Skalski 2015-10-22 15:01:40 +02:00
parent d815b685c1
commit bc428a4f00
4 changed files with 23 additions and 7 deletions

View File

@ -1,4 +1,4 @@
[gerrit]
host=review.openstack.org
port=29418
project=stackforge/fuel-plugin-opendaylight.git
project=openstack/fuel-plugin-opendaylight.git

View File

@ -6,14 +6,12 @@ class opendaylight::service (
$nodes_hash = hiera('nodes', {})
$roles = node_roles($nodes_hash, hiera('uid'))
$management_vip = hiera('management_vip')
$karaf_default_features = ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management']
$karaf_odl_features = ['odl-restconf-all', 'odl-aaa-authn', 'odl-dlux-all', 'odl-mdsal-apidocs', 'odl-ovsdb-openstack']
$odl = hiera("opendaylight")
$features = $odl['metadata']['odl_features']
$enable = {}
if member($roles, 'primary-controller') {
$features = union($karaf_default_features, $karaf_odl_features)
firewall {'215 odl':
port => [ $opendaylight::rest_api_port, 6633, 6640, 6653, 8181, 8101],
proto => 'tcp',
@ -44,6 +42,9 @@ class opendaylight::service (
content => template('opendaylight/custom.properties.erb'),
}
$enable['default'] = $features['default']
$enable['ovsdb'] = $features['ovsdb']
file { '/opt/opendaylight/etc/org.apache.karaf.features.cfg':
ensure => file,
owner => 'odl',

View File

@ -41,7 +41,7 @@ featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.3/xml/features
#
# Comma separated list of features to install at startup
#
featuresBoot=<%= @features.join(',') %>
featuresBoot=<%= @enable.map{|k,v| "#{v.join(',')}"}.join(',') %>
#
# Defines if the boot features are started in asynchronous mode (in a dedicated thread)

View File

@ -2,6 +2,21 @@ attributes:
metadata:
restrictions:
- "cluster:net_provider != 'neutron'": "Only neutron is supported by OpenDaylight"
odl_features:
default:
- config
- standard
- region
- package
- kar
- ssh
- management
ovsdb:
- odl-restconf-all
- odl-aaa-authn
- odl-dlux-all
- odl-mdsal-apidocs
- odl-ovsdb-openstack
use_vxlan:
type: "checkbox"
weight: 20