Fix error message when adding dnsforwardzone without forwarders.

This commit is contained in:
Rafael Guterres Jeffman
2020-06-10 22:20:20 -03:00
parent f8ebca760d
commit 3f785bc0e9
2 changed files with 16 additions and 2 deletions

View File

@@ -217,6 +217,11 @@ def main():
# Make sure forwardzone exists
existing_resource = find_dnsforwardzone(ansible_module, name)
# validate parameters
if state == 'present':
if existing_resource is None and not forwarders:
ansible_module.fail_json(msg='No forwarders specified.')
if existing_resource is None and operation == "update":
# does not exist and is updating
# trying to update something that doesn't exist, so error