Browse Source

Make health monitor resource creation to be conditional

Change-Id: If11726f73941079862a6fe7c37b76c3413579b84
changes/56/817756/10
Federico Ressi 6 months ago
parent
commit
b3fad42c1b
  1. 6
      tobiko/openstack/stacks/_octavia.py
  2. 16
      tobiko/openstack/stacks/octavia/pool.yaml

6
tobiko/openstack/stacks/_octavia.py

@ -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):

16
tobiko/openstack/stacks/octavia/pool.yaml

@ -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

Loading…
Cancel
Save