Fixes host absent when DNS zone is not found.

Since ipahost uses dnsrecord-show, it raises an error when DNS zone is
not found, but it should not be an ipahost concern.

This patch fixes this behavior by returning no record if DNS zone is
not found, so processing resumes as if there is no record for the host.
It fixes behavior when `state: absent` and dnszone does not exist, so,
host should not exist either, and the ipahost answer is correct and
indifferent to DNS Zone state.
This commit is contained in:
Rafael Guterres Jeffman
2020-06-01 12:26:43 -03:00
parent 44af47d93a
commit 05a1aaed53
2 changed files with 13 additions and 1 deletions

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