Remove OpenDaylight support

... because OpenDaylight tempmates and environemtns were alredy removed
in tripleo-heat-teampltes[1].

[1] 9c3638b8a13ea08a1bab95c9cd6ab335b729b6b3

Change-Id: I0204b6985de71441e0f63f21cfda24d55fd340e5
This commit is contained in:
Takashi Kajinami 2020-04-13 20:53:52 +09:00
parent 4072d4033d
commit 474d20438a
20 changed files with 12 additions and 854 deletions

View File

@ -52,10 +52,6 @@ mod 'systemd',
:git => 'https://github.com/camptocamp/puppet-systemd',
:ref => '20a465b0d8751bc08913b556d0a5b7fdac139271'
mod 'opendaylight',
:git => 'https://git.opendaylight.org/gerrit/integration/packaging/puppet-opendaylight',
:ref => 'master'
# NOTE(aschultz): rsyslog broke backwards compatibility with
# https://github.com/voxpupuli/puppet-rsyslog/pull/136
mod 'rsyslog',

View File

@ -1,14 +0,0 @@
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

View File

@ -1,53 +0,0 @@
Puppet::Functions.create_function(:synchronize_odl_ovs_flows) do
dispatch :synchronize_odl_ovs_flows do
param 'String', :of_controller_uri
end
def synchronize_odl_ovs_flows(of_controller_uri)
flow_tables = [
18, 19, 20, 22, 23, 24, 43, 45, 48, 50, 51, 60, 80, 81, 90, 210, 211,
212, 213, 214, 215, 216, 217, 239, 240, 241, 242, 243, 244, 245, 246, 247
]
retries = 5
i = 0
# wait for controller to be set
while i <= retries
of_ctrlr = `ovs-vsctl get-controller br-int`
if !of_ctrlr.empty?
break
end
i = i + 1
sleep(5)
end
if i >= 6
raise Puppet::Error, "OF controller for OVS was never set by ODL"
end
# check OF pipeline, and resync if necessary
i = 0
while i <= retries
of_synchronized = true
flow_tables.each do |table|
of_output = `ovs-ofctl -O openflow13 dump-flows br-int | grep table=#{table}`
if of_output.empty?
of_synchronized = false
break
end
end
# check if need to resync
if of_synchronized == true
return true
else
resync_output = `ovs-vsctl del-controller br-int && ovs-vsctl set-controller br-int #{of_controller_uri}`
if ! ($?.exited? && $?.exitstatus == 0)
raise Puppet::Error, "Unable to reset OpenFlow controller for bridge br-int: #{resync_output}"
end
end
i = i + 1
# wait for openflow pipeline to be pushed by ODL
sleep(10)
end
return false
end
end

View File

@ -14,7 +14,7 @@
#
# == Class: tripleo::certmonger::neutron
#
# Request a certificate for the opendaylight service and do the necessary setup.
# Request a certificate for the Neutron service and do the necessary setup.
#
# === Parameters
#

View File

@ -1,73 +0,0 @@
# Copyright 2017 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# == Class: tripleo::certmonger::opendaylight
#
# Request a certificate for the opendaylight service and do the necessary setup.
#
# === Parameters
#
# [*hostname*]
# The hostname of the node. this will be set in the CN of the certificate.
#
# [*service_certificate*]
# The path to the certificate that will be used for TLS in this service.
#
# [*service_key*]
# The path to the key that will be used for TLS in this service.
#
# [*certmonger_ca*]
# (Optional) The CA that certmonger will use to generate the certificates.
# Defaults to hiera('certmonger_ca', 'local').
#
# [*postsave_cmd*]
# (Optional) Specifies the command to execute after requesting a certificate.
# Defaults to 'if systemctl -q is-active opendaylight; then systemctl restart opendaylight; else true; fi'
#
# [*principal*]
# (Optional) The haproxy service principal that is set for opendaylight in kerberos.
# Defaults to undef
#
class tripleo::certmonger::opendaylight (
$hostname,
$service_certificate,
$service_key,
$certmonger_ca = hiera('certmonger_ca', 'local'),
$postsave_cmd = 'if systemctl -q is-active opendaylight; then systemctl restart opendaylight; else true; fi',
$principal = undef,
) {
include certmonger
certmonger_certificate { 'opendaylight' :
ensure => 'present',
certfile => $service_certificate,
keyfile => $service_key,
hostname => $hostname,
dnsname => $hostname,
principal => $principal,
postsave_cmd => $postsave_cmd,
ca => $certmonger_ca,
wait => true,
require => Class['::certmonger'],
}
file { $service_certificate :
require => Certmonger_certificate['opendaylight']
}
file { $service_key :
require => Certmonger_certificate['opendaylight']
}
File[$service_certificate] -> Odl_keystore<| title == 'controller' |>
File[$service_key] -> Odl_keystore<| title == 'controller' |>
}

View File

@ -14,7 +14,7 @@
#
# == Class: tripleo::certmonger::redis
#
# Request a certificate for RabbitMQ and do the necessary setup.
# Request a certificate for Redis and do the necessary setup.
#
# === Parameters
#

View File

@ -343,10 +343,6 @@
# (optional) Enable or not Ceph Dashboard binding
# Defaults to hiera('ceph_mgr_enabled', false)
#
# [*opendaylight*]
# (optional) Enable or not OpenDaylight binding
# Defaults to hiera('opendaylight_api_enabled', false)
#
# [*ovn_dbs*]
# (optional) Enable or not OVN northd binding
# Defaults to hiera('ovn_dbs_enabled', false)
@ -489,10 +485,6 @@
# (optional) Specify the network octavia is running on.
# Defaults to hiera('octavia_api_network', undef)
#
# [*opendaylight_network*]
# (optional) Specify the network opendaylight is running on.
# Defaults to hiera('opendaylight_api_network', undef)
#
# [*panko_network*]
# (optional) Specify the network panko is running on.
# Defaults to hiera('panko_api_network', undef)
@ -553,7 +545,6 @@
# 'nova_novnc_ssl_port' (Defaults to 13080)
# 'octavia_api_port' (Defaults to 9876)
# 'octavia_api_ssl_port' (Defaults to 13876)
# 'opendaylight_api_port' (Defaults to 8081)
# 'panko_api_port' (Defaults to 8977)
# 'panko_api_ssl_port' (Defaults to 13977)
# 'placement_port' (Defaults to 8778)
@ -653,7 +644,6 @@ class tripleo::haproxy (
$redis_password = undef,
$zaqar_api = hiera('zaqar_api_enabled', false),
$ceph_rgw = hiera('ceph_rgw_enabled', false),
$opendaylight = hiera('opendaylight_api_enabled', false),
$ovn_dbs = hiera('ovn_dbs_enabled', false),
$ovn_dbs_manage_lb = false,
$zaqar_ws = hiera('zaqar_api_enabled', false),
@ -687,7 +677,6 @@ class tripleo::haproxy (
$nova_osapi_network = hiera('nova_api_network', undef),
$placement_network = hiera('placement_network', undef),
$octavia_network = hiera('octavia_api_network', undef),
$opendaylight_network = hiera('opendaylight_api_network', undef),
$panko_network = hiera('panko_api_network', undef),
$ovn_dbs_network = hiera('ovn_dbs_network', undef),
$ec2_api_network = hiera('ec2_api_network', undef),
@ -739,8 +728,6 @@ class tripleo::haproxy (
nova_novnc_ssl_port => 13080,
octavia_api_port => 9876,
octavia_api_ssl_port => 13876,
opendaylight_api_port => 8081,
opendaylight_ws_port => 8185,
panko_api_port => 8977,
panko_api_ssl_port => 13977,
placement_port => 8778,
@ -1519,38 +1506,6 @@ class tripleo::haproxy (
}
}
if $opendaylight {
::tripleo::haproxy::endpoint { 'opendaylight':
internal_ip => unique([hiera('opendaylight_api_vip', $controller_virtual_ip), $controller_virtual_ip]),
service_port => $ports[opendaylight_api_port],
ip_addresses => hiera('opendaylight_api_node_ips', $controller_hosts_real),
server_names => hiera('opendaylight_api_node_names', $controller_hosts_names_real),
mode => 'http',
member_options => union($haproxy_member_options, $internal_tls_member_options),
service_network => $opendaylight_network,
listen_options => merge($default_listen_options,
{ 'option' => [ 'httpchk GET /diagstatus', 'httplog' ] }),
}
::tripleo::haproxy::endpoint { 'opendaylight_ws':
internal_ip => unique([hiera('opendaylight_api_vip', $controller_virtual_ip), $controller_virtual_ip]),
service_port => $ports[opendaylight_ws_port],
ip_addresses => hiera('opendaylight_api_node_ips', $controller_hosts_real),
server_names => hiera('opendaylight_api_node_names', $controller_hosts_names_real),
mode => 'http',
service_network => $opendaylight_network,
listen_options => {
# NOTE(jaosorior): Websockets have more overhead in establishing
# connections than regular HTTP connections. Also, since it begins
# as an HTTP connection and then "upgrades" to a TCP connection, some
# timeouts get overridden by others at certain times of the connection.
# The following values were taken from the following site:
# http://blog.haproxy.com/2012/11/07/websockets-load-balancing-with-haproxy/
'timeout' => ['connect 5s', 'client 25s', 'server 25s', 'tunnel 3600s'],
},
}
}
if $octavia {
::tripleo::haproxy::endpoint { 'octavia':
public_virtual_ip => $public_virtual_ip,

View File

@ -9,8 +9,8 @@
# Defaults to hiera('step')
#
# [*controller_node_ip*]
# (Optional) controller node ip, contains either odl,
# ovn or openstack controller ip.
# (Optional) controller node ip, contains either ovn or openstack controller
# ip.
#
# [*tenant_subnet*]
# (required) Tenant network's ip of the compute node
@ -37,10 +37,6 @@
# (optional) used by Liquidio service only when bonding
# is disabled, input format is <extrenal-network-name>:interface
#
# [*opendaylight_api_vip*]
# (optional) used by Liquidio service to communicate with ODL Controller
# Defaults to hiera('opendaylight_api_vip')
#
# [*ovn_dbs_vip*]
# (optional) used by Liquidio service to communicate with OVN Controller
# Defaults to hiera('ovn_dbs_vip')
@ -61,7 +57,6 @@ class tripleo::host::liquidio::compute (
$provider_mappings,
$tenant_subnet = hiera('tenant_subnet'),
$step = Integer(hiera('step')),
$opendaylight_api_vip = hiera('opendaylight_api_vip', undef),
$ovn_dbs_vip = hiera('ovn_dbs_vip', undef),
$controller_virtual_ip = hiera('controller_virtual_ip', undef),
$pci_passthrough = hiera('nova::compute::pci::passthrough', undef),
@ -70,7 +65,6 @@ class tripleo::host::liquidio::compute (
if $step >= 5 {
case $configure_mode {
'ml2-odl': { $controller_node_ip = $opendaylight_api_vip }
'ml2-ovn': { $controller_node_ip = $ovn_dbs_vip }
default : { $controller_node_ip = $controller_virtual_ip }

View File

@ -122,16 +122,6 @@
# it will create.
# Defaults to hiera('tripleo::profile::base::etcd::certificate_specs', {}).
#
# [*odl_certificate_specs*]
# (Optional) The specifications to give to certmonger for the certificate(s)
# it will create.
# Defaults to hiera('tripleo::profile::base::odl::certificate_specs', {}).
#
# [*ovs_certificate_specs*]
# (Optional) The specifications to give to certmonger for the certificate(s)
# it will create.
# Defaults to hiera('tripleo::profile::base::ovs::certificate_specs', {}).
#
# [*neutron_certificate_specs*]
# (Optional) The specifications to give to certmonger for the certificate(s)
# it will create.
@ -200,8 +190,6 @@ class tripleo::profile::base::certmonger_user (
$rabbitmq_certificate_specs = hiera('tripleo::profile::base::rabbitmq::certificate_specs', {}),
$redis_certificate_specs = hiera('redis_certificate_specs', {}),
$etcd_certificate_specs = hiera('tripleo::profile::base::etcd::certificate_specs', {}),
$odl_certificate_specs = hiera('tripleo::profile::base::neutron::opendaylight::certificate_specs', {}),
$ovs_certificate_specs = hiera('tripleo::profile::base::neutron::plugins::ovs::opendaylight::certificate_specs', {}),
$neutron_certificate_specs = hiera('tripleo::profile::base::neutron::certificate_specs', {}),
$novnc_proxy_certificates_specs = hiera('novnc_proxy_certificates_specs',{}),
$ceph_grafana_certificate_specs = hiera('ceph_grafana_certificate_specs', {}),
@ -286,12 +274,6 @@ class tripleo::profile::base::certmonger_user (
unless empty($etcd_certificate_specs) {
ensure_resource('class', 'tripleo::certmonger::etcd', $etcd_certificate_specs)
}
unless empty($odl_certificate_specs) {
ensure_resource('class', 'tripleo::certmonger::opendaylight', $odl_certificate_specs)
}
unless empty($ovs_certificate_specs) {
ensure_resource('class', 'tripleo::certmonger::openvswitch', $ovs_certificate_specs)
}
unless empty($neutron_certificate_specs) {
ensure_resource('class', 'tripleo::certmonger::neutron', $neutron_certificate_specs)
}

View File

@ -1,84 +0,0 @@
# Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# == Class: tripleo::profile::base::neutron::opendaylight
#
# OpenDaylight Neutron profile for TripleO
#
# === Parameters
#
# [*step*]
# (Optional) The current step of the deployment
# Defaults to hiera('step')
#
# [*odl_api_ips*]
# (Optional) List of OpenStack Controller IPs for ODL API
# Defaults to hiera('opendaylight_api_node_ips')
#
# [*certificate_specs*]
# (Optional) The specifications to give to certmonger for the certificate
# it will create. Note that the certificate nickname must be 'etcd' in
# the case of this service.
# Example with hiera:
# tripleo::profile::base::etcd::certificate_specs:
# hostname: <overcloud controller fqdn>
# service_certificate: <service certificate path>
# service_key: <service key path>
# principal: "etcd/<overcloud controller fqdn>"
# Defaults to {}.
#
# [*enable_internal_tls*]
# (Optional) Whether TLS in the internal network is enabled or not.
# Defaults to hiera('enable_internal_tls', false)
#
class tripleo::profile::base::neutron::opendaylight (
$step = Integer(hiera('step')),
$odl_api_ips = hiera('opendaylight_api_node_ips'),
$certificate_specs = {},
$enable_internal_tls = hiera('enable_internal_tls', false),
) {
validate_legacy(Hash, 'validate_hash', $certificate_specs)
if $enable_internal_tls {
$tls_certfile = $certificate_specs['service_certificate']
$tls_keyfile = $certificate_specs['service_key']
} else {
$tls_certfile = undef
$tls_keyfile = undef
}
if $step >= 1 {
validate_legacy(Array, 'validate_array', $odl_api_ips)
if empty($odl_api_ips) {
fail('No IPs assigned to OpenDaylight Api Service')
} elsif size($odl_api_ips) == 2 {
fail('2 node OpenDaylight deployments are unsupported. Use 1 or greater than 2')
} elsif size($odl_api_ips) > 2 {
class { 'opendaylight':
enable_ha => true,
ha_node_ips => $odl_api_ips,
enable_tls => $enable_internal_tls,
tls_key_file => $tls_keyfile,
tls_cert_file => $tls_certfile
}
} else {
class { 'opendaylight':
enable_tls => $enable_internal_tls,
tls_key_file => $tls_keyfile,
tls_cert_file => $tls_certfile
}
}
}
}

View File

@ -72,10 +72,6 @@ class tripleo::profile::base::neutron::plugins::ml2 (
include neutron::plugins::ml2::bigswitch::restproxy
}
if ('opendaylight' in $mechanism_drivers) or ('opendaylight_v2' in $mechanism_drivers) {
include tripleo::profile::base::neutron::plugins::ml2::opendaylight
}
if 'ovn' in $mechanism_drivers {
include tripleo::profile::base::neutron::plugins::ml2::ovn
}

View File

@ -1,88 +0,0 @@
# Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# == Class: tripleo::profile::base::neutron::plugins::ml2::opendaylight
#
# OpenDaylight ML2 Neutron profile for TripleO
#
# === Parameters
#
# [*odl_port*]
# (Optional) Port to use for OpenDaylight
# Defaults to hiera('opendaylight::odl_rest_port')
#
# [*odl_username*]
# (Optional) Username to configure for OpenDaylight
# Defaults to 'admin'
#
# [*odl_password*]
# (Optional) Password to configure for OpenDaylight
# Defaults to 'admin'
#
# [*odl_url_ip*]
# (Optional) Virtual IP address for ODL Api Service
# Defaults to hiera('opendaylight_api_vip')
#
# [*conn_proto*]
# (Optional) Protocol to use to for ODL REST access
# Defaults to 'http'
#
# [*enable_internal_tls*]
# (Optional) Whether TLS in the internal network is enabled or not.
# Defaults to hiera('enable_internal_tls', false)
#
# [*internal_api_fqdn*]
# (Optional) FQDN.
# Defaults to hiera('cloud_name_internal_api')
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# 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'),
$odl_password = hiera('opendaylight::password'),
$odl_url_ip = hiera('opendaylight_api_vip'),
$conn_proto = 'http',
$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
}
class { 'neutron::plugins::ml2::opendaylight':
odl_username => $odl_username,
odl_password => $odl_password,
odl_url => "${conn_proto}://${odl_url_addr}:${odl_port}/controller/nb/v2/neutron",
}
}
}

View File

@ -1,159 +0,0 @@
# Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# == Class: tripleo::profile::base::neutron::plugins::ovs::opendaylight
#
# OpenDaylight Neutron OVS profile for TripleO
#
# === Parameters
#
# [*odl_port*]
# (Optional) Port to use for OpenDaylight
# Defaults to hiera('opendaylight::odl_rest_port')
#
# [*odl_check_url*]
# (Optional) URL path used to check if ODL is up
# Defaults to hiera('opendaylight_check_url')
#
# [*odl_api_ips*]
# (Optional) List of OpenStack Controller IPs for ODL API
# Defaults to hiera('opendaylight_api_node_ips')
#
# [*odl_url_ip*]
# (Optional) Virtual IP address for ODL Api Service
# Defaults to hiera('opendaylight_api_vip')
#
# [*conn_proto*]
# (Optional) Protocol to use to for ODL REST access
# Defaults to 'http'
#
# [*certificate_specs*]
# (Optional) The specifications to give to certmonger for the certificate
# it will create. Note that the certificate nickname must be 'etcd' in
# the case of this service.
# Example with hiera:
# tripleo::profile::base::etcd::certificate_specs:
# hostname: <overcloud controller fqdn>
# service_certificate: <service certificate path>
# service_key: <service key path>
# principal: "etcd/<overcloud controller fqdn>"
# Defaults to {}.
#
# [*enable_internal_tls*]
# (Optional) Whether TLS in the internal network is enabled or not.
# Defaults to hiera('enable_internal_tls', false)
#
# [*tunnel_ip*]
# (Optional) IP to use for Tenant VXLAN/GRE tunneling source address
# Defaults to hiera('tripleo::profile::base::neutron::plugins::ovs::opendaylight::tunnel_ip')
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
# Defaults to hiera('step')
#
# [*vhostuser_socket_group*]
# (Optional) Group name for vhostuser socket dir.
# Defaults to qemu
#
# [*vhostuser_socket_user*]
# (Optional) User name for vhostuser socket dir.
# Defaults to qemu
#
# [*vhostuser_socket_dir*]
# (Optional) vhostuser socket dir, The directory where $vhostuser_socket_dir
# 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'),
$odl_api_ips = hiera('opendaylight_api_node_ips'),
$odl_url_ip = hiera('opendaylight_api_vip'),
$conn_proto = 'http',
$certificate_specs = {},
$enable_internal_tls = hiera('enable_internal_tls', false),
$tunnel_ip = hiera('tripleo::profile::base::neutron::plugins::ovs::opendaylight::tunnel_ip'),
$step = Integer(hiera('step')),
$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 {
if $vhostuser_socket_dir {
file { $vhostuser_socket_dir:
ensure => directory,
owner => $vhostuser_socket_user,
group => $vhostuser_socket_group,
mode => '0775',
}
}
}
if $step >= 4 {
if empty($odl_api_ips) { fail('No IPs assigned to OpenDaylight API Service') }
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_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_parsed, '.+', 'ssl:\0:6640'), ' ')
} else {
$tls_certfile = undef
$tls_keyfile = undef
$odl_ovsdb_str = join(regsubst($odl_api_ips_parsed, '.+', 'tcp:\0:6640'), ' ')
}
class { 'neutron::plugins::ovs::opendaylight':
tunnel_ip => $tunnel_ip,
odl_check_url => $opendaylight_url,
odl_ovsdb_iface => $odl_ovsdb_str,
enable_tls => $enable_internal_tls,
tls_key_file => $tls_keyfile,
tls_cert_file => $tls_certfile,
enable_ipv6 => $enable_ipv6
}
}
if $step >= 5 {
$odl_of_mgr = regsubst($odl_ovsdb_str , ':6640', ':6653', 'G')
# Workaround until OpenDayight is capable of synchronizing flows
if ! synchronize_odl_ovs_flows($odl_of_mgr) {
fail('Failed to validate OVS OpenFlow pipeline')
}
}
}

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
Support for OpenDaylight has been removed because its templates and
environment files are already removed in tripleo-heat-templates.

View File

@ -1,67 +0,0 @@
#
# Copyright (C) 2017 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Unit tests for tripleo
#
require 'spec_helper'
describe 'tripleo::certmonger::opendaylight' do
let :params do
{ :hostname => 'localhost',
:service_certificate => '/etc/pki/tls/certs/odl.crt',
:service_key => '/etc/pki/tls/private/odl.key',
}
end
shared_examples_for 'tripleo::certmonger::opendaylight' do
before :each do
facts.merge!({ :step => 1 })
end
it 'should include the base for using certmonger' do
is_expected.to contain_class('certmonger')
end
it 'should request a certificate' do
is_expected.to contain_certmonger_certificate('opendaylight').with(
:ensure => 'present',
:certfile => params[:service_certificate],
:keyfile => params[:service_key],
:hostname => 'localhost',
:dnsname => 'localhost',
:ca => 'local',
:wait => true,
)
is_expected.to contain_file(params[:service_certificate]).with(
:require => 'Certmonger_certificate[opendaylight]'
)
is_expected.to contain_file(params[:service_key]).with(
:require => 'Certmonger_certificate[opendaylight]'
)
end
end
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({})
end
it_behaves_like 'tripleo::certmonger::opendaylight'
end
end
end

View File

@ -4,17 +4,15 @@ describe 'tripleo::host::liquidio::compute' do
let :params do
{
:vf_nums => '4',
:configure_mode => 'ml2-odl',
:bonding_options => 'active-backup',
:enable_bonding => true,
:vf_nums => '4',
:bonding_options => 'active-backup',
:enable_bonding => true,
:provider_mappings => 'datacentre:eth1',
}
end
it 'configures parameters' do
is_expected.to contain_liquidio_config('main/vf_nums').with_value('4')
is_expected.to contain_liquidio_config('main/configure_mode').with_value('ml2-odl')
is_expected.to contain_liquidio_config('main/bonding_options').with_value('')
is_expected.to contain_liquidio_config('main/enable_bonding').with_value(true)
is_expected.to contain_liquidio_config('main/provider_mappings').with_value('datacentre:eth1')

View File

@ -1,97 +0,0 @@
#
# Copyright (C) 2018 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
require 'spec_helper'
describe 'tripleo::profile::base::neutron::plugins::ml2::opendaylight' do
let :params do
{ :step => 4,
:odl_port => 8081,
:odl_username => 'dummy',
:odl_password => 'dummy'
}
end
shared_examples_for 'tripleo::profile::base::neutron::plugins::ml2::opendaylight' do
before :each do
facts.merge!({ :step => params[:step] })
end
context 'with no TLS and API IP empty' do
before do
params.merge!({
:odl_url_ip => '',
:internal_api_fqdn => [],
})
end
it_raises 'a Puppet::Error',/OpenDaylight API VIP is Empty/
end
context 'with no TLS' do
before do
params.merge!({
:odl_url_ip => '192.168.24.2',
:internal_api_fqdn => [],
})
end
it 'should configure ML2' do
is_expected.to contain_class('neutron::plugins::ml2::opendaylight').with(
:odl_username => params[:odl_username],
:odl_password => params[:odl_password],
:odl_url => "http://#{params[:odl_url_ip]}:#{params[:odl_port]}/controller/nb/v2/neutron"
)
end
end
context 'with TLS and FQDN empty' do
before do
params.merge!({
:enable_internal_tls => true,
:internal_api_fqdn => [],
:odl_url_ip => '192.168.24.2'
})
end
it_raises 'a Puppet::Error',/Internal API FQDN is Empty/
end
context 'with TLS' do
before do
params.merge!({
:enable_internal_tls => true,
:conn_proto => 'https',
:internal_api_fqdn => 'example.cloud.org',
:odl_url_ip => '192.168.24.2'
})
end
it 'should configure ML2' do
is_expected.to contain_class('neutron::plugins::ml2::opendaylight').with(
:odl_username => params[:odl_username],
:odl_password => params[:odl_password],
:odl_url => "https://#{params[:internal_api_fqdn]}:#{params[:odl_port]}/controller/nb/v2/neutron"
)
end
end
end
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({ :hostname => 'node.example.com' })
end
it_behaves_like 'tripleo::profile::base::neutron::plugins::ml2::opendaylight'
end
end
end

View File

@ -1,126 +0,0 @@
#
# Copyright (C) 2017 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
require 'spec_helper'
describe 'tripleo::profile::base::neutron::opendaylight' do
let :params do
{ :step => 1
}
end
shared_examples_for 'tripleo::profile::base::neutron::opendaylight' do
before :each do
facts.merge!({ :step => params[:step] })
end
context 'with noha' do
before do
params.merge!({
:odl_api_ips => ['192.0.2.5']
})
end
it 'should install and configure opendaylight' do
is_expected.to contain_class('opendaylight')
end
end
context 'with empty OpenDaylight API IPs' do
before do
params.merge!({
:odl_api_ips => []
})
end
it 'should fail to install OpenDaylight' do
is_expected.to compile.and_raise_error(/No IPs assigned to OpenDaylight Api Service/)
end
end
context 'with 2 OpenDaylight API IPs' do
before do
params.merge!({
:odl_api_ips => ['192.0.2.5', '192.0.2.6']
})
end
it 'should fail to install OpenDaylight' do
is_expected.to compile.and_raise_error(/2 node OpenDaylight deployments are unsupported. Use 1 or greater than 2/)
end
end
context 'with HA and 3 OpenDaylight API IPs' do
before do
params.merge!({
:odl_api_ips => ['192.0.2.5', '192.0.2.6', '192.0.2.7']
})
end
it 'should install and configure OpenDaylight in HA' do
is_expected.to contain_class('opendaylight').with(
:enable_ha => true,
:ha_node_ips => params[:odl_api_ips],
:enable_tls => false
)
end
end
context 'with TLS enabled' do
before do
params.merge!({
:enable_internal_tls => true,
:certificate_specs => {
"service_certificate" => "/etc/pki/tls/certs/odl.crt",
"service_key" => "/etc/pki/tls/private/odl.key"}
})
end
it 'should and configure OpenDaylight with TLS' do
is_expected.to contain_class('opendaylight').with(
:enable_tls => true,
:tls_key_file => params[:certificate_specs]['service_key'],
:tls_cert_file => params[:certificate_specs]['service_certificate']
)
end
end
context 'with TLS and HA enabled' do
before do
params.merge!({
:enable_internal_tls => true,
:certificate_specs => {
"service_certificate" => "/etc/pki/tls/certs/odl.crt",
"service_key" => "/etc/pki/tls/private/odl.key"},
:odl_api_ips => ['192.0.2.5', '192.0.2.6', '192.0.2.7']
})
end
it 'should and configure OpenDaylight with TLS and HA' do
is_expected.to contain_class('opendaylight').with(
:enable_tls => true,
:tls_key_file => params[:certificate_specs]['service_key'],
:tls_cert_file => params[:certificate_specs]['service_certificate'],
:enable_ha => true,
:ha_node_ips => params[:odl_api_ips]
)
end
end
end
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({ :hostname => 'node.example.com' })
end
it_behaves_like 'tripleo::profile::base::neutron::opendaylight'
end
end
end

View File

@ -176,10 +176,6 @@ tripleo::haproxy_basic_auth::haproxy_userlists:
redis_short_bootstrap_node_name: node
redis_vip: '127.0.0.1'
redis::bind: '10.0.0.1'
# OpenDaylight
neutron::plugins::ovs::opendaylight::odl_port: '8081'
neutron::plugins::ovs::opendaylight::odl_username: 'admin'
neutron::plugins::ovs::opendaylight::odl_password: 'admin'
# swift related
swift_proxy_short_bootstrap_node_name: node
# zaqar related

View File

@ -1,5 +1,2 @@
---
step: 1
opendaylight_api_node_ips:
- '192.0.2.5'
opendaylight::tls_keystore_password: 'password'