Revert "Allow ovn_db_host to be of type array"

We shouldn't override the hieradata but rather be explicit about which
mode we're operating in. e.g. pacemaker or not. This will help in
troubleshooting and not rely on hieradata overrides to work.

This reverts commit 0b51d8258c.

Related-Bug: #1931133
Change-Id: Id8df4fe5ce26dbcdeb7ba073ecb2199cf392b03b
This commit is contained in:
Alex Schultz 2021-06-07 09:56:59 -06:00
parent fb44599b20
commit fad7e3fb90
3 changed files with 7 additions and 31 deletions

View File

@ -17,9 +17,7 @@
# OVN Neutron agent profile for tripleo # OVN Neutron agent profile for tripleo
# #
# [*ovn_db_host*] # [*ovn_db_host*]
# (Optional) The IP-Address where OVN DBs are listening. If passed a list it # (Optional) The IP-Address where OVN DBs are listening.
# will construct a comma separated string like
# protocol:ip1:port,protocol:ip2:port.
# Defaults to hiera('ovn_dbs_vip') # Defaults to hiera('ovn_dbs_vip')
# #
# [*ovn_sbdb_port*] # [*ovn_sbdb_port*]
@ -53,14 +51,8 @@ class tripleo::profile::base::neutron::agents::ovn (
$ovn_chassis_mac_map = hiera('ovn_chassis_mac_map', undef), $ovn_chassis_mac_map = hiera('ovn_chassis_mac_map', undef),
) { ) {
if $step >= 4 { if $step >= 4 {
if is_string($ovn_db_host) {
$ovn_remote_real = join(["${protocol}", normalize_ip_for_uri($ovn_db_host), "${ovn_sbdb_port}"], ':')
} elsif is_array($ovn_db_host) {
$ovn_remote_real = join($ovn_db_host.map |$i| { "${protocol}:${normalize_ip_for_uri($i)}:${ovn_sbdb_port}" }, ',')
}
class { 'ovn::controller': class { 'ovn::controller':
ovn_remote => $ovn_remote_real, ovn_remote => join([$protocol, normalize_ip_for_uri($ovn_db_host), "${ovn_sbdb_port}"], ':'),
enable_ovn_match_northd => true, enable_ovn_match_northd => true,
ovn_chassis_mac_map => $ovn_chassis_mac_map, ovn_chassis_mac_map => $ovn_chassis_mac_map,
} }

View File

@ -19,8 +19,7 @@
# === Parameters # === Parameters
# #
# [*ovn_db_host*] # [*ovn_db_host*]
# The IP-Address where OVN DBs are listening. If passed a list it will construct # The IP-Address where OVN DBs are listening.
# a comma separated string like protocol:ip1:port,protocol:ip2:port.
# Defaults to hiera('ovn_dbs_vip') # Defaults to hiera('ovn_dbs_vip')
# #
# [*ovn_sb_port*] # [*ovn_sb_port*]
@ -66,15 +65,8 @@ class tripleo::profile::base::neutron::ovn_metadata (
) { ) {
if $step >= 4 { if $step >= 4 {
include tripleo::profile::base::neutron include tripleo::profile::base::neutron
if is_string($ovn_db_host) {
$ovn_sb_connection_real = join(["${protocol}", normalize_ip_for_uri($ovn_db_host), "${ovn_sb_port}"], ':')
} elsif is_array($ovn_db_host) {
$ovn_sb_connection_real = join($ovn_db_host.map |$i| { "${protocol}:${normalize_ip_for_uri($i)}:${ovn_sb_port}" }, ',')
}
class { 'neutron::agents::ovn_metadata': class { 'neutron::agents::ovn_metadata':
ovn_sb_connection => $ovn_sb_connection_real, ovn_sb_connection => join(["${protocol}", normalize_ip_for_uri($ovn_db_host), "${ovn_sb_port}"], ':'),
ovn_sb_private_key => $ovn_sb_private_key, ovn_sb_private_key => $ovn_sb_private_key,
ovn_sb_certificate => $ovn_sb_certificate, ovn_sb_certificate => $ovn_sb_certificate,
ovn_sb_ca_cert => $ovn_sb_ca_cert, ovn_sb_ca_cert => $ovn_sb_ca_cert,

View File

@ -17,8 +17,7 @@
# OVN Neutron ML2 profile for tripleo # OVN Neutron ML2 profile for tripleo
# #
# [*ovn_db_host*] # [*ovn_db_host*]
# The IP-Address where OVN DBs are listening. If passed a list it will construct # The IP-Address where OVN DBs are listening.
# a comma separated string like protocol:ip1:port,protocol:ip2:port.
# Defaults to hiera('ovn_dbs_vip') # Defaults to hiera('ovn_dbs_vip')
# #
# [*ovn_nb_port*] # [*ovn_nb_port*]
@ -80,16 +79,9 @@ class tripleo::profile::base::neutron::plugins::ml2::ovn (
$step = Integer(hiera('step')) $step = Integer(hiera('step'))
) { ) {
if $step >= 4 { if $step >= 4 {
if is_string($ovn_db_host) {
$ovn_nb_connection_real = join(["${protocol}", normalize_ip_for_uri($ovn_db_host), "${ovn_nb_port}"], ':')
$ovn_sb_connection_real = join(["${protocol}", normalize_ip_for_uri($ovn_db_host), "${ovn_sb_port}"], ':')
} elsif is_array($ovn_db_host) {
$ovn_nb_connection_real = join($ovn_db_host.map |$i| { "${protocol}:${normalize_ip_for_uri($i)}:${ovn_nb_port}" }, ',')
$ovn_sb_connection_real = join($ovn_db_host.map |$i| { "${protocol}:${normalize_ip_for_uri($i)}:${ovn_sb_port}" }, ',')
}
class { 'neutron::plugins::ml2::ovn': class { 'neutron::plugins::ml2::ovn':
ovn_nb_connection => $ovn_nb_connection_real, ovn_nb_connection => join(["${protocol}", normalize_ip_for_uri($ovn_db_host), "${ovn_nb_port}"], ':'),
ovn_sb_connection => $ovn_sb_connection_real, ovn_sb_connection => join(["${protocol}", normalize_ip_for_uri($ovn_db_host), "${ovn_sb_port}"], ':'),
ovn_nb_private_key => $ovn_nb_private_key, ovn_nb_private_key => $ovn_nb_private_key,
ovn_nb_certificate => $ovn_nb_certificate, ovn_nb_certificate => $ovn_nb_certificate,
ovn_nb_ca_cert => $ovn_nb_ca_cert, ovn_nb_ca_cert => $ovn_nb_ca_cert,