Contrail plugin for Fuel 9.0

- components.yaml file added for component registry feature
- install.sh script updated with new package names
- hiera overrides updated
- neutron-related tasks updated

Change-Id: I34f046a743c9065275cf124ac3ef888139c8580c
This commit is contained in:
Oleksandr Martsyniuk 2015-12-18 10:33:38 +02:00
parent 8eb744f8f8
commit fd34c8c8af
12 changed files with 71 additions and 73 deletions

13
components.yaml Normal file
View File

@ -0,0 +1,13 @@
- name: 'network:neutron:contrail'
label: 'Contrail'
description: 'Contrail SDN networking'
bind: !!pairs
- "cluster:net_provider": "neutron"
- "cluster:net_segment_type": "tun"
compatible:
- name: 'hypervisor:kvm'
- name: 'hypervisor:qemu'
incompatible:
- name: 'hypervisor:vmware'
description: 'Contrail plugin is not compatible with VMware for now'

View File

@ -21,7 +21,7 @@ case $operatingsystem
package {'yum-plugin-priorities': ensure => present }
}
Ubuntu: {
file { '/etc/apt/preferences.d/contrail-3.0.0.pref':
file { '/etc/apt/preferences.d/contrail-3.0.1.pref':
ensure => absent,
}
}

View File

@ -16,21 +16,11 @@ notice('MODULAR: contrail/controller-hiera-post.pp')
include contrail
$hiera_dir = '/etc/hiera/override'
$plugin_name = 'contrail'
$plugin_yaml = "${plugin_name}.yaml"
$contrail_plugin = hiera('contrail', undef)
file {'/etc/hiera/override':
ensure => directory,
}
# Post-install
# Create predefined_networks for OSTF-nets in controller-provision.pp
if empty($contrail::nets) {
file { "${hiera_dir}/${plugin_yaml}":
file { '/etc/hiera/plugins/contrail.yaml':
ensure => file,
content => template('contrail/plugins.yaml.erb'),
require => File['/etc/hiera/override']
}
}

View File

@ -14,28 +14,10 @@
notice('MODULAR: contrail/controller-hiera-pre.pp')
include contrail
$hiera_dir = '/etc/hiera/override'
$plugin_name = 'contrail'
$plugin_yaml = "${plugin_name}.yaml"
$contrail_plugin = hiera('contrail', undef)
file_line {"${plugin_name}_hiera_override":
path => '/etc/hiera.yaml',
line => " - override/${plugin_name}",
after => ' - override/module/%{calling_module}',
} ->
file {'/etc/hiera/override':
ensure => directory,
}
# Pre-deploy
# Empty predefined_networks to skip OSTF nets creation
# in openstack-network-controller.pp
file { "${hiera_dir}/${plugin_yaml}":
file { '/etc/hiera/plugins/contrail.yaml':
ensure => file,
content => 'quantum_settings: { predefined_networks: [] }',
require => File['/etc/hiera/override']
content => 'neutron_config: { predefined_networks: [] }',
}

View File

@ -92,9 +92,6 @@ class contrail::controller {
require => Package['contrail-heat'],
}
# Disable neutron agents
contrail::pcs_delete_resource { $contrail::disabled_services: }
# Contrail-specific ceilometer settings
$ceilometer_enabled = $contrail::ceilometer_hash['enabled']

View File

@ -33,16 +33,19 @@ class contrail {
$public_ssl_hash = hiera('public_ssl')
$public_ssl = $public_ssl_hash['services']
$neutron_settings = hiera_hash('quantum_settings', {})
$metadata_secret = $neutron_settings['metadata']['metadata_proxy_shared_secret']
$service_token = $neutron_settings['keystone']['admin_password']
$nets = $neutron_settings['predefined_networks']
$neutron_config = hiera_hash('neutron_config', {})
$floating_net = try_get_value($neutron_config, 'default_floating_net', 'net04_ext')
$private_net = try_get_value($neutron_config, 'default_private_net', 'net04')
$default_router = try_get_value($neutron_config, 'default_router', 'router04')
$nets = $neutron_config['predefined_networks']
$default_ceilometer_hash = { 'enabled' => false }
$ceilometer_hash = hiera_hash('ceilometer', $default_ceilometer_hash)
$keystone = hiera_hash('keystone', {})
$admin_token = $keystone['admin_token']
$keystone = hiera_hash('keystone', {})
$admin_token = $keystone['admin_token']
$service_token = $neutron_config['keystone']['admin_password']
$metadata_secret = $neutron_config['metadata']['metadata_proxy_shared_secret']
$admin_settings = hiera_hash('access', {})
$admin_username = $admin_settings['user']
@ -74,9 +77,6 @@ class contrail {
$contrail_private_vip = $network_metadata['vips']['contrail_priv']['ipaddr']
$contrail_mgmt_vip = $contrail_private_vip
$disabled_services = ['neutron-plugin-openvswitch-agent','neutron-dhcp-agent',
'neutron-metadata-agent','neutron-l3-agent']
# Settings for RabbitMQ on contrail controllers
$rabbit = hiera('rabbit')
$rabbit_password = $rabbit['password']

View File

@ -1,7 +0,0 @@
# Define to delete PCS resources
define contrail::pcs_delete_resource {
exec { "Delete-pcs-resource-${name}":
command => "/usr/sbin/pcs resource delete clone_p_${name}",
onlyif => "/usr/sbin/crm resource show clone_p_${name}",
}
}

View File

@ -14,18 +14,19 @@
class contrail::provision_controller {
contrail::create_network{'net04':
netdata => $contrail::nets['net04'],
contrail::create_network{$contrail::private_net:
netdata => $contrail::nets[$contrail::private_net],
} ->
contrail::create_network{'net04_ext':
netdata => $contrail::nets['net04_ext'],
contrail::create_network{$contrail::floating_net:
netdata => $contrail::nets[$contrail::floating_net],
notify => Exec['prov_route_target'],
} ->
openstack::network::create_router{'router04':
internal_network => 'net04',
external_network => 'net04_ext',
neutron_router{$contrail::default_router:
ensure => present,
internal_network => $contrail::private_net,
external_network => $contrail::floating_net,
tenant_name => $contrail::admin_tenant
}
@ -33,13 +34,13 @@ exec { 'prov_route_target':
provider => 'shell',
path => '/usr/bin:/bin:/sbin',
command => "python /usr/share/contrail-utils/add_route_target.py \
--routing_instance_name default-domain:${contrail::admin_tenant}:net04_ext:net04_ext \
--routing_instance_name default-domain:${contrail::admin_tenant}:${contrail::floating_net}:${contrail::floating_net} \
--route_target_number ${contrail::route_target} --router_asn ${contrail::asnum} \
--api_server_ip ${contrail::contrail_mgmt_vip} --api_server_port 8082 \
--admin_user neutron --admin_tenant_name services --admin_password '${contrail::service_token}' \
&& touch /etc/contrail/prov_route_target-DONE",
creates => '/etc/contrail/prov_route_target-DONE',
require => Contrail::Create_Network['net04_ext'],
require => Contrail::Create_Network[$contrail::floating_net],
}
}

View File

@ -5,9 +5,12 @@ external_gw=scope.function_get_first_ip([external_cidr])
floating_end=scope.function_get_last_ip([external_cidr])
floating_start=scope.function_get_ip_from_range([external_gw,floating_end,external_netmask,'1','first'])
%>
quantum_settings:
neutron_config:
default_floating_net: <%= scope.lookupvar('contrail::floating_net') %>
default_private_net: <%= scope.lookupvar('contrail::private_net') %>
default_router: <%= scope.lookupvar('contrail::default_router') %>
predefined_networks:
net04_ext:
<%= scope.lookupvar('contrail::floating_net') %>:
shared: true
L2:
router_ext: true
@ -17,7 +20,7 @@ quantum_settings:
floating: <%= floating_start %>:<%= floating_end %>
gateway: <%= external_gw %>
enable_dhcp: true
net04:
<%= scope.lookupvar('contrail::private_net') %>:
shared: false
L2:
router_ext: false

View File

@ -218,18 +218,32 @@
# Create overrides for Hiera on Controllers: empty predefined_nets
- id: controller-hiera-pre
type: puppet
groups: [primary-controller]
required_for: [openstack-network]
groups: [primary-controller,controller]
required_for: [openstack-network-start]
requires: [deploy_start, globals]
parameters:
puppet_manifest: puppet/manifests/controller-hiera-pre.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 120
# Skip L3 and DHCP Neutron agents
- id: primary-openstack-network-agents-l3
type: skipped
- id: openstack-network-agents-l3
type: skipped
- id: primary-openstack-network-agents-dhcp
type: skipped
- id: openstack-network-agents-dhcp
type: skipped
- id: openstack-network-networks
type: skipped
- id: openstack-network-routers
type: skipped
# Create overrides for Hiera on Controllers: contrail-specific predefined_nets
- id: controller-hiera-post
type: puppet
role: [primary-controller]
role: [primary-controller,controller]
required_for: [post_deployment_end]
requires: [post_deployment_start]
parameters:
@ -248,12 +262,12 @@
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
# Create networks for ostf-tests and provision route target
# Create networks for ostf-tests, provision route target
- id: openstack-controller-provision
type: puppet
role: [primary-controller]
required_for: [post_deployment_end]
requires: [openstack-controller-contrail-primary]
requires: [openstack-network-networks]
parameters:
puppet_manifest: puppet/manifests/controller-provision.pp
puppet_modules: puppet/modules:/etc/puppet/modules
@ -270,6 +284,10 @@
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
# Workaround for #1550450
- id: enable_nova_compute_service
type: skipped
# Remove Open vSwitch packages, install and configure Contrail vRouter dkms kernel module
- id: contrail-compute-provision
type: puppet

View File

@ -32,7 +32,7 @@ PLUGIN_PATH="/var/www/nailgun/plugins/contrail-3.0"
UBUNTU_PKG=`find $PLUGIN_PATH -maxdepth 1 -name 'contrail-install-packages*.deb' -exec stat -c "%y %n" {} + | sort -r | head -n 1 | cut -d' ' -f 4`
CENTOS_PKG=`find $PLUGIN_PATH -maxdepth 1 -name 'contrail-install-packages*.rpm' -exec stat -c "%y %n" {} + | sort -r | head -n 1 | cut -d' ' -f 4`
yum -y install dpkg-devel createrepo
yum -y install dpkg dpkg-dev createrepo
if [ ! -f "$UBUNTU_PKG" ] && [ ! -f "$CENTOS_PKG" ];
then

View File

@ -3,22 +3,23 @@ name: contrail
# Human-readable name for your plugin
title: Fuel Contrail plugin
# Plugin version
version: 3.0.0
version: 3.0.1
# 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
fuel_version: ['7.0']
fuel_version: ['9.0']
is_hotpluggable: false
# The plugin is compatible with releases in the list
releases:
- os: ubuntu
version: 2015.1.0-7.0
version: liberty-9.0
mode: ['ha', 'multinode']
deployment_scripts_path: deployment_scripts/
repository_path: repositories/ubuntu
# Version of plugin package
package_version: '3.0.0'
package_version: '4.0.0'
licenses: ['Apache 2.0']
authors: ['Mirantis Inc.']
homepage: https://github.com/openstack/fuel-plugin-contrail