Merge "Add support for ovn clustered DB in the octavia ovn-provider"
This commit is contained in:
commit
9d09f9487d
|
@ -31,6 +31,15 @@
|
|||
# (Optional) The IP-Address where OVN DBs are listening.
|
||||
# Defaults to lookup('ovn_dbs_vip')
|
||||
#
|
||||
# [*ovn_db_node_ips*]
|
||||
# (Optional) The OVN DBs node ip addresses are listening.
|
||||
# Defaults to lookup('ovn_dbs_node_ips', undef, undef, undef)
|
||||
#
|
||||
# [*ovn_db_clustered*]
|
||||
# (Optional) Boolean indicating if we're running with ovn db clustering
|
||||
# or pacemaker. Defaults to false for backwards compatibility
|
||||
# Defaults to lookup('ovn_db_clustered', undef, undef, false)
|
||||
#
|
||||
# [*ovn_nb_port*]
|
||||
# (Optional) Port number on which northbound database is listening
|
||||
# Defaults to lookup('ovn::northbound::port')
|
||||
|
@ -53,6 +62,8 @@ class tripleo::profile::base::octavia::provider::ovn (
|
|||
$step = Integer(lookup('step')),
|
||||
$protocol = lookup('ovn_nb_connection_protocol', undef, undef, 'tcp'),
|
||||
$ovn_db_host = lookup('ovn_dbs_vip', undef, undef, undef),
|
||||
$ovn_db_node_ips = lookup('ovn_dbs_node_ips', undef, undef, undef),
|
||||
$ovn_db_clustered = lookup('ovn_db_clustered', undef, undef, false),
|
||||
$ovn_nb_port = lookup('ovn::northbound::port', undef, undef, undef),
|
||||
$ovn_nb_private_key = $::os_service_default,
|
||||
$ovn_nb_certificate = $::os_service_default,
|
||||
|
@ -63,20 +74,24 @@ class tripleo::profile::base::octavia::provider::ovn (
|
|||
|
||||
if ($step >= 4) {
|
||||
# For backward compatibility
|
||||
# TODO(tkajinam): Remove these deprecated parameters
|
||||
if $::tripleo::profile::base::octavia::api::ovn_db_host and !is_service_default(::tripleo::profile::base::octavia::api::ovn_db_host) {
|
||||
$ovn_db_host_real = $::tripleo::profile::base::octavia::api::ovn_db_host
|
||||
$ovn_nb_port_real = $::tripleo::profile::base::octavia::api::ovn_nb_port
|
||||
}
|
||||
else {
|
||||
$ovn_db_host_real = $ovn_db_host
|
||||
$ovn_nb_port_real = $ovn_nb_port
|
||||
$ovn_db_hosts_real = any2array($::tripleo::profile::base::octavia::api::ovn_db_host)
|
||||
$ovn_nb_port_real = $::tripleo::profile::base::octavia::api::ovn_nb_port
|
||||
} elsif $ovn_db_clustered {
|
||||
$ovn_db_hosts_real = any2array($ovn_db_node_ips)
|
||||
$ovn_nb_port_real = $ovn_nb_port
|
||||
} else {
|
||||
$ovn_db_hosts_real = any2array($ovn_db_host)
|
||||
$ovn_nb_port_real = $ovn_nb_port
|
||||
}
|
||||
|
||||
if $ovn_db_host_real {
|
||||
$ovn_nb_conn_args = ["${protocol}", normalize_ip_for_uri($ovn_db_host_real), "${ovn_nb_port_real}"].filter |$c| { !$c.empty() }
|
||||
$ovn_nb_connection = join($ovn_nb_conn_args, ':')
|
||||
if ! empty($ovn_db_hosts_real) {
|
||||
$nb_conn = $ovn_db_hosts_real.map |$h| {
|
||||
join([$protocol, normalize_ip_for_uri($h), "${ovn_nb_port_real}"].filter |$c| { !$c.empty() }, ':')
|
||||
}
|
||||
class { 'octavia::provider::ovn':
|
||||
ovn_nb_connection => $ovn_nb_connection,
|
||||
ovn_nb_connection => join(any2array($nb_conn), ','),
|
||||
ovn_nb_private_key => $ovn_nb_private_key,
|
||||
ovn_nb_certificate => $ovn_nb_certificate,
|
||||
ovn_nb_ca_cert => $ovn_nb_ca_cert,
|
||||
|
|
Loading…
Reference in New Issue