Fix enable_snat parameter (#44418)

Fixes the issue #44285
This commit is contained in:
Guilherme Steinmuller 2018-08-20 17:59:05 -03:00 committed by ansibot
parent 9b2baebe64
commit b7139782cf

View file

@ -42,7 +42,6 @@ options:
description: description:
- Enable Source NAT (SNAT) attribute. - Enable Source NAT (SNAT) attribute.
type: bool type: bool
default: 'yes'
network: network:
description: description:
- Unique name or ID of the external gateway network. - Unique name or ID of the external gateway network.
@ -307,6 +306,7 @@ def _build_kwargs(cloud, module, router, network):
if network: if network:
kwargs['ext_gateway_net_id'] = network['id'] kwargs['ext_gateway_net_id'] = network['id']
# can't send enable_snat unless we have a network # can't send enable_snat unless we have a network
if module.params['enable_snat']:
kwargs['enable_snat'] = module.params['enable_snat'] kwargs['enable_snat'] = module.params['enable_snat']
if module.params['external_fixed_ips']: if module.params['external_fixed_ips']:
@ -371,7 +371,7 @@ def main():
state=dict(default='present', choices=['absent', 'present']), state=dict(default='present', choices=['absent', 'present']),
name=dict(required=True), name=dict(required=True),
admin_state_up=dict(type='bool', default=True), admin_state_up=dict(type='bool', default=True),
enable_snat=dict(type='bool', default=True), enable_snat=dict(type='bool'),
network=dict(default=None), network=dict(default=None),
interfaces=dict(type='list', default=None), interfaces=dict(type='list', default=None),
external_fixed_ips=dict(type='list', default=None), external_fixed_ips=dict(type='list', default=None),