Fix discovering node roles

Role can change during deployment, we need to compare role name with
list of all roles assigned to node.

Change-Id: I02aecfe8ac9cd9ec2ea8569d8bb98eb55fe79749
This commit is contained in:
Michal Skalski 2015-07-03 17:16:18 +02:00
parent df4f3f8f2b
commit a726b8720b
5 changed files with 14 additions and 10 deletions

View File

@ -69,7 +69,7 @@ OpenDaylight plugin installation
id | name | version | package_version
---|--------------|---------|----------------
1 | opendaylight | 0.5.1 | 2.0.0
1 | opendaylight | 0.5.2 | 2.0.0
9. Plugin is ready to use and can be enabled on the Settings tab of the Fuel web UI.
@ -114,7 +114,7 @@ None.
Release Notes
-------------
**0.5.1**
**0.5.2**
* Initial release of the plugin. This is a beta version.

View File

@ -1,11 +1,12 @@
$role = hiera('role')
$nodes_hash = hiera('nodes', {})
$roles = node_roles($nodes_hash, hiera('uid'))
$ovs_agent_name = $operatingsystem ? {
'CentOS' => 'neutron-openvswitch-agent',
'Ubuntu' => 'neutron-plugin-openvswitch-agent',
}
if $role == 'primary-controller' {
if member($roles, 'primary-controller') {
cs_resource { "p_${ovs_agent_name}":
ensure => absent,
}

View File

@ -4,7 +4,9 @@ $access_hash = hiera('access', {})
$keystone_admin_tenant = $access_hash[tenant]
$neutron_settings = hiera('quantum_settings')
$nets = $neutron_settings['predefined_networks']
$primary_controller = hiera('primary_controller')
$nodes_hash = hiera('nodes', {})
$roles = node_roles($nodes_hash, hiera('uid'))
$physnet = $nets['net04']['L2']['physnet']
$segment_id = $nets['net04']['L2']['segment_id']
@ -30,7 +32,7 @@ service { 'neutron-server':
ensure => running,
}
if $primary_controller {
if member($roles, 'primary-controller') {
exec {'refresh-dhcp-agent':
command => 'crm resource restart p_neutron-dhcp-agent',
path => '/usr/bin:/usr/sbin',

View File

@ -3,9 +3,10 @@ class opendaylight::service (
$bind_address = undef
) {
$role = hiera('role')
$nodes_hash = hiera('nodes', {})
$roles = node_roles($nodes_hash, hiera('uid'))
if $role == 'primary-controller' {
if member($roles, 'primary-controller') {
firewall {'215 odl':
port => [ $opendaylight::rest_api_port, 6633, 6640, 6653, 8181, 8101],
proto => 'tcp',
@ -44,7 +45,7 @@ class opendaylight::service (
}
}
if ($role == 'primary-controller') or ($role == 'controller') {
if member($roles, 'controller') or member($roles, 'primary-controller') {
include opendaylight::ha::haproxy
}

View File

@ -3,7 +3,7 @@ name: opendaylight
# Human-readable name for your plugin
title: OpenDaylight Helium plugin
# Plugin version
version: '0.5.1'
version: '0.5.2'
# Description
description: 'This plugin provides OpenDaylight as a backend for neutron.
Use the same IP address as for OpenStack Horizon and port 8181 to reach dlux web ui and apidoc explorer.