diff --git a/changelogs/fragments/45921-os_router-ignores-enable_snat-no.yml b/changelogs/fragments/45921-os_router-ignores-enable_snat-no.yml new file mode 100644 index 00000000000..7ffeb5e43ec --- /dev/null +++ b/changelogs/fragments/45921-os_router-ignores-enable_snat-no.yml @@ -0,0 +1,2 @@ +bugfixes: + - "os_router - ``enable_snat: no`` was ignored." diff --git a/lib/ansible/modules/cloud/openstack/os_router.py b/lib/ansible/modules/cloud/openstack/os_router.py index 763098c7b55..643215028b3 100644 --- a/lib/ansible/modules/cloud/openstack/os_router.py +++ b/lib/ansible/modules/cloud/openstack/os_router.py @@ -306,7 +306,7 @@ 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 - if module.params['enable_snat']: + if module.params.get('enable_snat') is not None: kwargs['enable_snat'] = module.params['enable_snat'] if module.params['external_fixed_ips']: