Fix enable_snat parameter (#44418) (#44451)

* Fix enable_snat parameter (#44418)

Fixes the issue #44285
(cherry picked from commit b7139782cf)

* Fix enable_snat parameter (#44418)

Fixes the issue #44285
(cherry picked from commit b7139782cf)

* Fix enable_snat parameter (#44418)

Fixes the issue #44285
(cherry picked from commit b7139782cf)
This commit is contained in:
Guilherme Steinmuller 2018-09-05 15:06:06 -03:00 committed by Matt Davis
parent 8854f77d67
commit 12d0684ee2
2 changed files with 7 additions and 3 deletions

View file

@ -0,0 +1,3 @@
bugfixes:
- fix the enable_snat parameter that is only supposed to be used by an user
with the right policies. https://github.com/ansible/ansible/pull/44418

View file

@ -42,7 +42,7 @@ options:
description:
- Enable Source NAT (SNAT) attribute.
required: false
default: true
type: bool
network:
description:
- Unique name or ID of the external gateway network.
@ -317,7 +317,8 @@ def _build_kwargs(cloud, module, router, network):
if network:
kwargs['ext_gateway_net_id'] = network['id']
# can't send enable_snat unless we have a network
kwargs['enable_snat'] = module.params['enable_snat']
if module.params['enable_snat']:
kwargs['enable_snat'] = module.params['enable_snat']
if module.params['external_fixed_ips']:
kwargs['ext_fixed_ips'] = []
@ -381,7 +382,7 @@ def main():
state=dict(default='present', choices=['absent', 'present']),
name=dict(required=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),
interfaces=dict(type='list', default=None),
external_fixed_ips=dict(type='list', default=None),