mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-30 03:14:42 +00:00
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:
@@ -452,7 +452,7 @@ def find_dnsrecord(module, name):
|
|||||||
_args)
|
_args)
|
||||||
except ipalib_errors.NotFound as e:
|
except ipalib_errors.NotFound as e:
|
||||||
msg = str(e)
|
msg = str(e)
|
||||||
if "record not found" in msg:
|
if "record not found" in msg or "zone not found" in msg:
|
||||||
return None
|
return None
|
||||||
module.fail_json(msg="dnsrecord_show failed: %s" % msg)
|
module.fail_json(msg="dnsrecord_show failed: %s" % msg)
|
||||||
|
|
||||||
|
|||||||
12
tests/host/test_host_no_zone.yml
Normal file
12
tests/host/test_host_no_zone.yml
Normal 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
|
||||||
Reference in New Issue
Block a user