diff options
author | Guilherme Steinmuller <gsteinmuller@vexxhost.com> | 2018-08-20 17:59:05 -0300 |
---|---|---|
committer | ansibot <ansibot@users.noreply.github.com> | 2018-08-20 16:59:05 -0400 |
commit | b7139782cfa7d631a204c38021e4ed59e9e5d956 (patch) | |
tree | 98382b32faba9462b36d611061c3c5af355560ce | |
parent | 9b2baebe64bf31eecec995af80c0501434b3c2fe (diff) | |
download | ansible-b7139782cfa7d631a204c38021e4ed59e9e5d956.tar.gz |
Fix enable_snat parameter (#44418)
Fixes the issue #44285
-rw-r--r-- | lib/ansible/modules/cloud/openstack/os_router.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ansible/modules/cloud/openstack/os_router.py b/lib/ansible/modules/cloud/openstack/os_router.py index d59982c137..763098c7b5 100644 --- a/lib/ansible/modules/cloud/openstack/os_router.py +++ b/lib/ansible/modules/cloud/openstack/os_router.py @@ -42,7 +42,6 @@ options: description: - Enable Source NAT (SNAT) attribute. type: bool - default: 'yes' network: description: - Unique name or ID of the external gateway network. @@ -307,7 +306,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'] = [] @@ -371,7 +371,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), |