mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-11-24 09:53:37 +00:00
Merge "feat: add option to specify the availability zone for a newly created loadbalancer"
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
minor_changes:
|
||||||
|
- loadbalancer - Add option to specify the availability zone a loadbalancer should be created in.
|
||||||
@@ -64,6 +64,10 @@ options:
|
|||||||
choices: [present, absent]
|
choices: [present, absent]
|
||||||
default: present
|
default: present
|
||||||
type: str
|
type: str
|
||||||
|
availability_zone:
|
||||||
|
description:
|
||||||
|
- The availability zone, in which the load balancer will be deployed.
|
||||||
|
type: str
|
||||||
vip_address:
|
vip_address:
|
||||||
description:
|
description:
|
||||||
- IP address of the load balancer virtual IP.
|
- IP address of the load balancer virtual IP.
|
||||||
@@ -279,6 +283,7 @@ class LoadBalancerModule(OpenStackModule):
|
|||||||
floating_ip_network=dict(aliases=['public_network']),
|
floating_ip_network=dict(aliases=['public_network']),
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
state=dict(default='present', choices=['absent', 'present']),
|
state=dict(default='present', choices=['absent', 'present']),
|
||||||
|
availability_zone=dict(),
|
||||||
vip_address=dict(),
|
vip_address=dict(),
|
||||||
vip_network=dict(),
|
vip_network=dict(),
|
||||||
vip_port=dict(),
|
vip_port=dict(),
|
||||||
@@ -337,7 +342,7 @@ class LoadBalancerModule(OpenStackModule):
|
|||||||
def _build_update(self, load_balancer):
|
def _build_update(self, load_balancer):
|
||||||
update = {}
|
update = {}
|
||||||
|
|
||||||
non_updateable_keys = [k for k in ['name', 'vip_address']
|
non_updateable_keys = [k for k in ['name', 'vip_address', 'availability_zone']
|
||||||
if self.params[k] is not None
|
if self.params[k] is not None
|
||||||
and self.params[k] != load_balancer[k]]
|
and self.params[k] != load_balancer[k]]
|
||||||
|
|
||||||
@@ -456,7 +461,7 @@ class LoadBalancerModule(OpenStackModule):
|
|||||||
|
|
||||||
def _create(self):
|
def _create(self):
|
||||||
kwargs = dict((k, self.params[k])
|
kwargs = dict((k, self.params[k])
|
||||||
for k in ['description', 'name', 'vip_address']
|
for k in ['description', 'name', 'vip_address', 'availability_zone']
|
||||||
if self.params[k] is not None)
|
if self.params[k] is not None)
|
||||||
|
|
||||||
flavor_name_or_id = self.params['flavor']
|
flavor_name_or_id = self.params['flavor']
|
||||||
|
|||||||
Reference in New Issue
Block a user