Add support for ODL-OVS IPv6 deployment
Make necessary changes for proper deployment of ODL on IPv6 network. Change-Id: Id7a0986f886a81b2041987b0d5a95edf2160e05e Depends-On: Idd257cf4666b853eb4c52861f9f400b6dbdeeadb Partial-Bug: #1783196
This commit is contained in:
parent
dd67adb7b8
commit
66292a5886
14
lib/puppet/functions/add_brackets.rb
Normal file
14
lib/puppet/functions/add_brackets.rb
Normal file
@ -0,0 +1,14 @@
|
||||
Puppet::Functions.create_function(:add_brackets) do
|
||||
dispatch :add_brackets do
|
||||
param 'String', :odl_ip
|
||||
end
|
||||
|
||||
def add_brackets(odl_ip)
|
||||
if odl_ip =~ /\[.*\]/
|
||||
return odl_ip
|
||||
else
|
||||
bracketed_ip = "[#{odl_ip}]"
|
||||
return bracketed_ip
|
||||
end
|
||||
end
|
||||
end
|
@ -51,6 +51,10 @@
|
||||
# for more details.
|
||||
# Defaults to hiera('step')
|
||||
#
|
||||
# [*enable_ipv6*]
|
||||
# (Optional) Whether all IPs are IPv6 address or not.
|
||||
# Defaults to hiera(''enable_ipv6', false)
|
||||
#
|
||||
class tripleo::profile::base::neutron::plugins::ml2::opendaylight (
|
||||
$odl_port = hiera('opendaylight::odl_rest_port'),
|
||||
$odl_username = hiera('opendaylight::username'),
|
||||
@ -60,12 +64,17 @@ class tripleo::profile::base::neutron::plugins::ml2::opendaylight (
|
||||
$enable_internal_tls = hiera('enable_internal_tls', false),
|
||||
$internal_api_fqdn = hiera('cloud_name_internal_api'),
|
||||
$step = Integer(hiera('step')),
|
||||
$enable_ipv6 = hiera('enable_ipv6', false),
|
||||
) {
|
||||
|
||||
if $step >= 4 {
|
||||
if $enable_internal_tls {
|
||||
if empty($internal_api_fqdn) { fail('Internal API FQDN is Empty') }
|
||||
$odl_url_addr = $internal_api_fqdn
|
||||
} elsif $enable_ipv6 {
|
||||
# NOTE: Works when both tls and v6 are true as fqdn doesnot need [ ] around it, only v6 IP needs
|
||||
# Needs testing with both TLS and v6 enabled.
|
||||
$odl_url_addr = add_brackets($odl_url_ip)
|
||||
} else {
|
||||
if empty($odl_url_ip) { fail('OpenDaylight API VIP is Empty') }
|
||||
$odl_url_addr = $odl_url_ip
|
||||
|
@ -76,6 +76,10 @@
|
||||
# will be created with correct permissions, inorder to support vhostuser
|
||||
# client mode.
|
||||
#
|
||||
# [*enable_ipv6*]
|
||||
# (Optional) Whether all IPs are IPv6 address or not.
|
||||
# Defaults to hiera(''enable_ipv6', false)
|
||||
#
|
||||
class tripleo::profile::base::neutron::plugins::ovs::opendaylight (
|
||||
$odl_port = hiera('opendaylight::odl_rest_port'),
|
||||
$odl_check_url = hiera('opendaylight_check_url'),
|
||||
@ -89,6 +93,7 @@ class tripleo::profile::base::neutron::plugins::ovs::opendaylight (
|
||||
$vhostuser_socket_group = hiera('tripleo::profile::base::neutron::plugins::ovs::opendaylight::vhostuser_socket_group', 'qemu'),
|
||||
$vhostuser_socket_user = hiera('tripleo::profile::base::neutron::plugins::ovs::opendaylight::vhostuser_socket_user', 'qemu'),
|
||||
$vhostuser_socket_dir = hiera('neutron::plugins::ovs::opendaylight::vhostuser_socket_dir', undef),
|
||||
$enable_ipv6 = hiera('enable_ipv6', false),
|
||||
) {
|
||||
|
||||
if $step >= 3 {
|
||||
@ -108,17 +113,29 @@ class tripleo::profile::base::neutron::plugins::ovs::opendaylight (
|
||||
|
||||
if empty($odl_url_ip) { fail('OpenDaylight API VIP is Empty') }
|
||||
|
||||
if $enable_ipv6 {
|
||||
$odl_api_ips_parsed = $odl_api_ips.map |$odl_api_ip| {
|
||||
add_brackets($odl_api_ip)
|
||||
}
|
||||
|
||||
$odl_url_ip_parsed = add_brackets($odl_url_ip)
|
||||
|
||||
} else {
|
||||
$odl_api_ips_parsed = $odl_api_ips
|
||||
$odl_url_ip_parsed = $odl_url_ip
|
||||
}
|
||||
|
||||
# Build URL to check if ODL is up before connecting OVS
|
||||
$opendaylight_url = "${conn_proto}://${odl_url_ip}:${odl_port}/${odl_check_url}"
|
||||
$opendaylight_url = "${conn_proto}://${odl_url_ip_parsed}:${odl_port}/${odl_check_url}"
|
||||
|
||||
if $enable_internal_tls {
|
||||
$tls_certfile = $certificate_specs['service_certificate']
|
||||
$tls_keyfile = $certificate_specs['service_key']
|
||||
$odl_ovsdb_str = join(regsubst($odl_api_ips, '.+', 'ssl:\0:6640'), ' ')
|
||||
$odl_ovsdb_str = join(regsubst($odl_api_ips_parsed, '.+', 'ssl:\0:6640'), ' ')
|
||||
} else {
|
||||
$tls_certfile = undef
|
||||
$tls_keyfile = undef
|
||||
$odl_ovsdb_str = join(regsubst($odl_api_ips, '.+', 'tcp:\0:6640'), ' ')
|
||||
$odl_ovsdb_str = join(regsubst($odl_api_ips_parsed, '.+', 'tcp:\0:6640'), ' ')
|
||||
}
|
||||
|
||||
class { '::neutron::plugins::ovs::opendaylight':
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Add support to enable ODL deployment on IPv6 networks
|
Loading…
x
Reference in New Issue
Block a user