Merge pull request #289 from rjeffman/fix_host_absent_no_dns_zone

Fixes host absent when DNS zone is not found.
This commit is contained in:
Thomas Woerner
2020-06-05 17:27:16 +02:00
committed by GitHub
2 changed files with 13 additions and 1 deletions

View File

@@ -452,7 +452,7 @@ def find_dnsrecord(module, name):
_args)
except ipalib_errors.NotFound as e:
msg = str(e)
if "record not found" in msg:
if "record not found" in msg or "zone not found" in msg:
return None
module.fail_json(msg="dnsrecord_show failed: %s" % msg)

View File

@@ -0,0 +1,12 @@
---
- name: Test host
hosts: ipaserver
become: yes
tasks:
- name: Ensure host with inexistent zone is absent.
ipahost:
name: host01.absentzone.test
state: absent
register: result
failed_when: result.failed or result.changed