From cb949d7bac7d63e7c4498120a5b46971fb8a94f4 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 9 Jul 2024 12:03:40 +0900 Subject: [PATCH] Use redis sentinel for taskflow backend Switch taskflow backend in scenario 005 from redis to redis sentinel to improve deployment architecture coverage. The feature is not yet available in ubuntu packages we use so the switch is done only in CentOS. Depends-on: https://review.opendev.org/923693 Change-Id: I1372ce42f8f416003adce1b3ff343779524fe215 --- README.md | 3 ++- fixtures/scenario005.pp | 5 ++++- manifests/octavia.pp | 34 +++++++++++++++++++++++++++------- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e482643c2..f235a4e8a 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,8 @@ scenario](#all-in-one). | om rpc | rabbit | rabbit | rabbit | rabbit | rabbit | rabbit | | om notify | rabbit | rabbit | rabbit | rabbit | rabbit | rabbit | | oslo.cache | redis | sentinel | memcache | memcache | memcache | memcache | -| tooz | redis | sentinel | redis | redis | redis | (redis) | +| tooz | redis | sentinel | redis | redis | redis | | +| jobboard | | | | redis | sentinel | | When the Jenkins slave is created, the *run_tests.sh* script will be executed. This script will execute *install_modules.sh* that prepare /etc/puppet/modules diff --git a/fixtures/scenario005.pp b/fixtures/scenario005.pp index 3089dd6d5..497206497 100644 --- a/fixtures/scenario005.pp +++ b/fixtures/scenario005.pp @@ -25,11 +25,13 @@ case $facts['os']['family'] { $ipv6 = false $modular_libvirt = false $ovn_metadata_agent_enabled = true + $jobboard_backend = 'redis' } 'RedHat': { $ipv6 = true $modular_libvirt = true $ovn_metadata_agent_enabled = false + $jobboard_backend = 'redis_sentinel' } default: { fail("Unsupported osfamily (${facts['os']['family']})") @@ -66,7 +68,8 @@ class { 'openstack_integration::nova': libvirt_guests_enabled => true, } class { 'openstack_integration::octavia': - provider_driver => 'ovn' + provider_driver => 'ovn', + jobboard_backend => $jobboard_backend, } class { 'openstack_integration::horizon': diff --git a/manifests/octavia.pp b/manifests/octavia.pp index 04a0b49fc..0bd242a15 100644 --- a/manifests/octavia.pp +++ b/manifests/octavia.pp @@ -8,9 +8,14 @@ # (optional) Provider driver used in Octavia. # Defaults to 'amphora'. # +# [*jobboard_backend*] +# (optional) Jobboard backend. +# Defaults to 'redis'. +# class openstack_integration::octavia ( $notification_topics = $facts['os_service_default'], $provider_driver = 'amphora', + $jobboard_backend = 'redis', ) { include openstack_integration::config @@ -161,9 +166,18 @@ class openstack_integration::octavia ( heartbeat_key => 'abcdefghijkl', } + $jobboard_redis_sentinel = $jobboard_backend ? { + 'redis_sentinel' => 'mymaster', + default => undef + } + $jobboard_backend_port = $jobboard_backend ? { + 'redis_sentinel' => 26379, + default => 6379, + } + class { 'octavia::task_flow': - max_workers => 2, - persistence_connection => os_database_connection({ + max_workers => 2, + persistence_connection => os_database_connection({ 'dialect' => 'mysql+pymysql', 'host' => $::openstack_integration::config::ip_for_url, 'username' => 'octavia', @@ -172,14 +186,20 @@ class openstack_integration::octavia ( 'charset' => 'utf8', 'extra' => $::openstack_integration::config::db_extra, }), - jobboard_enabled => true, - jobboard_backend_hosts => $::openstack_integration::config::host, - jobboard_backend_port => 6379, - jobboard_backend_password => 'a_big_secret', - jobboard_redis_backend_ssl_options => { + jobboard_enabled => true, + jobboard_backend_hosts => $::openstack_integration::config::host, + jobboard_backend_port => $jobboard_backend_port, + jobboard_backend_password => 'a_big_secret', + jobboard_redis_sentinel => $jobboard_redis_sentinel, + jobboard_redis_sentinel_password => 'a_big_secret', + jobboard_redis_backend_ssl_options => { 'ssl' => $::openstack_integration::config::ssl }, + jobboard_redis_sentinel_ssl_options => { + 'ssl' => $::openstack_integration::config::ssl + } } + class { 'octavia::worker': workers => 2, }