Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1733559

Summary: [ansible-freeipa] Reinitialize are failed to find node in ipatopology segments
Product: Red Hat Enterprise Linux 8 Reporter: Varun Mylaraiah <mvarun>
Component: ansible-freeipaAssignee: Thomas Woerner <twoerner>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1Flags: pm-rhel: mirror+
Target Milestone: rc   
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ansible-freeipa-0.1.6-3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 21:08:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Varun Mylaraiah 2019-07-26 13:59:31 UTC
Description of problem:
In ipatopology segments delete and reinitialize are failed to find the node are exists or not
 

Version-Release number of selected component (if applicable):
ansible-freeipa-0.1.6-2.el8.noarch

Steps to Reproduce:

# cat delete-topologysegment.yml
---
- name: Playbook to handle topologysegment
  hosts: ipaserver
  become: true

  tasks:
  - name: Delete topology segment
    ipatopologysegment:
      ipaadmin_password: <xxxxxxxxx>
      suffix: ca
      left: qwerty
      right: asdfg
      state: absent

# ansible-playbook -vv -i inventory/hosts.topologysegment delete-topologysegment.yml 
ansible-playbook 2.8.2
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.6.8 (default, Jul  3 2019, 10:59:07) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)]
No config file found; using defaults

PLAYBOOK: delete-topologysegment.yml ********************************************************************************
1 plays in delete-topologysegment.yml

PLAY [Playbook to handle topologysegment] ***************************************************************************

TASK [Gathering Facts] **********************************************************************************************
task path: /root/delete-topologysegment.yml:2
ok: [ipaserver.test.local]
META: ran handlers

TASK [Delete topology segment] **************************************************************************************
task path: /root/delete-topologysegment.yml:7
ok: [ipaserver.test.local] => {"changed": false}
META: ran handlers
META: ran handlers

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


Actual results:
Not getting any error if the node does not exist.

Expected results:
it should provide an error if the node does not exist.



Additional info:
upstream ticket: https://github.com/freeipa/ansible-freeipa/issues/107

Comment 1 Thomas Woerner 2019-07-26 16:14:35 UTC
Delete may not fail on a missing entry. This is a requirement for idempotency. But reinitalized should as it is not able to do the requested action.

Comment 2 Thomas Woerner 2019-07-26 17:46:09 UTC
Here is the upstream fix: https://github.com/freeipa/ansible-freeipa/commit/c212b43516cb870bbaa86c607dde33f373768043

Comment 4 Varun Mylaraiah 2019-08-01 11:01:30 UTC
# cat reinitialize-topologysegment.yml 
---
- name: Playbook to handle topologysegment
  hosts: ipaserver
  become: true

  tasks:
  - name: Reinitialize topology segment
    ipatopologysegment:
      ipaadmin_password: <xxxxxxxxxx>
      suffix: domain
      left: ipareplica1.test.local
      right: unknow-host
      direction: left-to-right
      state: reinitialized

# cat inventory/hosts.topologysegment  
[ipaserver]
ipaserver.test.local

#  ansible-playbook -vv -i inventory/hosts.topologysegment  reinitialize-topologysegment.yml 
ansible-playbook 2.8.3
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.6.8 (default, Jul  3 2019, 10:59:07) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)]
No config file found; using defaults

PLAYBOOK: reinitialize-topologysegment.yml **************************************************************************
1 plays in reinitialize-topologysegment.yml

PLAY [Playbook to handle topologysegment] ***************************************************************************

TASK [Gathering Facts] **********************************************************************************************
task path: /root/reinitialize-topologysegment.yml:2
ok: [ipaserver.test.local]
META: ran handlers

TASK [Reinitialize topology segment] ********************************************************************************
task path: /root/reinitialize-topologysegment.yml:7
fatal: [ipaserver.test.local]: FAILED! => {"changed": false, "msg": "No entry 'left=ipareplica1.test.local,right=unknow-host' for suffix 'domain'"}

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

Comment 5 Varun Mylaraiah 2019-08-01 11:35:19 UTC
Verified on ansible-freeipa-0.1.6-3.el8.noarch

Comment 7 errata-xmlrpc 2019-11-05 21:08:48 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-2019:3418