Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1804838 - Ensure a host is absent with a non-configure DNS zone fails.
Summary: Ensure a host is absent with a non-configure DNS zone fails.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: ansible-freeipa
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Thomas Woerner
QA Contact: ipa-qe
URL:
Whiteboard:
: 1804832 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-19 17:41 UTC by Rafael Jeffman
Modified: 2020-04-28 16:02 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 16:01:57 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:1705 0 None None None 2020-04-28 16:02:04 UTC

Description Rafael Jeffman 2020-02-19 17:41:15 UTC
Description of problem:

When using a playbook that ensures a host is absent, the playbook fails if the host zone is not configured, but it should not.

How reproducible:

always.

Steps to Reproduce:
1. Ensure the zone 'ihavenodns.info' is not configured in DNS.

2. Run playbook:

---
- name: Playbook to handle hosts
  hosts: ipaserver
  become: true

  tasks:
  - name: Ensure host is absent
    ipahost:
      name: host01.ihavenodns.info
      state: absent

Actual results:

PLAY [Playbook to handle hosts] ************************************************

TASK [Gathering Facts] *********************************************************
ok: [centos73.ipademo.local]

TASK [Ensure host host01.example.com is absent] ********************************
fatal: [centos73.ipademo.local]: FAILED! => {"changed": false, "msg": "example.com.: DNS zone not found"}

PLAY RECAP *********************************************************************
centos73.ipademo.local     : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   


Expected results:

Playbook should have ok=2 and failed=0.

Comment 1 Thomas Woerner 2020-02-20 12:20:54 UTC
*** Bug 1804832 has been marked as a duplicate of this bug. ***

Comment 4 Varun Mylaraiah 2020-02-29 00:03:49 UTC
Verified

Manual execution console output:
================================
# rpm -q ansible-freeipa
ansible-freeipa-0.1.8-3.el8.noarch

[root@ansible ~]# cat test3.yaml
---
- name: Playbook to handle hosts
  hosts: ipaserver
  become: true

  tasks:
  - ipahost:
      ipaadmin_password: <xxxxxx>
      name: host0.nodns.test
      state: absent


[root@ansible ~]# ansible-playbook -vv -i inventory/server.hosts test3.yaml 
ansible-playbook 2.9.5
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 3.6.8 (default, Dec  5 2019, 15:45:45) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
Using /etc/ansible/ansible.cfg as config file

PLAYBOOK: test3.yaml *****************************************************************************************************
1 plays in test3.yaml

PLAY [Playbook to handle hosts] ******************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************
task path: /root/test3.yaml:2
ok: [master.ipadomain.test]
META: ran handlers

TASK [ipahost] ***********************************************************************************************************
task path: /root/test3.yaml:7
ok: [master.ipadomain.test] => {"changed": false, "host": {}}
META: ran handlers
META: ran handlers

PLAY RECAP ***************************************************************************************************************
master.ipadomain.test      : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Comment 5 Varun Mylaraiah 2020-02-29 00:05:21 UTC
Automated test console output:
===============================
ansible_freeipa_tests/host_module.py::Testhost28::test_delete_host_with_nonconfigure_dns_zone 
-------------------------------- live log call ---------------------------------
[paramiko.transport] INFO Connected (version 2.0, client OpenSSH_8.0)
[paramiko.transport] INFO Authentication (publickey) successful!
[pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['ipactl', 'status']
[pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kinit', 'admin']
[pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['ipa', 'host-find']
[pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kdestroy', '-A']
[paramiko.transport] INFO Connected (version 2.0, client OpenSSH_8.0)
[paramiko.transport] INFO Authentication (publickey) successful!
[pytest_multihost.host.Host.ansible.ParamikoTransport] INFO WRITE inventory/host.hosts
[paramiko.transport.sftp] INFO [chan 0] Opened sftp connection (server version 3)
[pytest_multihost.host.Host.ansible.ParamikoTransport] INFO PUT host_module.yml
[pytest_multihost.host.Host.ansible.ParamikoTransport] INFO RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/host.hosts', 'host_module.yml']
PASSED                                                                   [100%

Comment 7 errata-xmlrpc 2020-04-28 16:01:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1705


Note You need to log in before you can comment on or make changes to this bug.