Make health monitor resource creation to be conditional

Change-Id: If11726f73941079862a6fe7c37b76c3413579b84
This commit is contained in:
Federico Ressi 2021-11-12 14:16:33 +01:00
parent 0036ed08cd
commit b3fad42c1b
2 changed files with 20 additions and 2 deletions

View File

@ -152,6 +152,9 @@ class OctaviaPoolStackFixture(heat.HeatStackFixture):
hm_timeout = 3
#: whenever to create the health monitor
has_monitor = True
@property
def listener_id(self):
return self.listener.listener_id
@ -247,6 +250,9 @@ class OctaviaOvnProviderPoolStackFixture(OctaviaPoolStackFixture):
lb_algorithm = 'SOURCE_IP_PORT'
#: There is any health monitor available for OVN provider
has_monitor = False
class OctaviaOvnProviderMemberServerStackFixture(
OctaviaMemberServerStackFixture):

View File

@ -1,4 +1,4 @@
heat_template_version: 2015-10-15
heat_template_version: newton
description: A pool for a Load Balancer
@ -17,7 +17,11 @@ parameters:
type: string
description: ID of the listener
# healthmonitor params
# Health monitor parameters
has_monitor:
type: boolean
description: whenever to create the health monitor
hm_delay:
type: number
default: 10
@ -43,6 +47,12 @@ parameters:
default: HTTP
description: Type of health-monitor
conditions:
has_monitor:
get_param: has_monitor
resources:
pool:
type: OS::Octavia::Pool
@ -53,6 +63,7 @@ resources:
monitor:
type: OS::Octavia::HealthMonitor
condition: has_monitor
properties:
delay: { get_param: hm_delay }
type: { get_param: hm_type }
@ -68,3 +79,4 @@ outputs:
monitor_id:
description: Healthmonitor ID
value: { get_resource: monitor }
condition: has_monitor