Bug 1881452

Summary: [ansible-freeipa] Also when tried to update multiple records with all attributes with type DS it creates new entry.
Product: Red Hat Enterprise Linux 8 Reporter: anuja <amore>
Component: ansible-freeipaAssignee: Rafael Jeffman <rjeffman>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: high    
Version: 8.3CC: mvarun, pcech, rjeffman, twoerner
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ansible-freeipa-0.3.0-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:51:18 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 anuja 2020-09-22 12:16:50 UTC
Description of problem:
Also when tried to update multiple records with all attributes with type DS it creates new entry.


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

[root@client ~]# ipa dnsrecord-show safezone.test iron01
  Record name: iron01
  A record: 12.1.105.77
  DS record: 12346 3 3 84763786e4213cca9a6938dba5dacd64f87ec216, 12343 3 3 84763786e4213cca9a6938dba5dacd64f87ec216
  NS record: iron01
[root@client ~]# 
[root@client ~]# cat test.yaml 
---
- name: Playbook to ensure
  hosts: ipaserver

  tasks:
  - ipadnsrecord:
      ipaadmin_password: Secret123
      zone_name: safezone.test
      records:
        - name: iron01
          ds_key_tag: 5555
          ds_algorithm: 5
          ds_digest_type: 5
          ds_digest: 84763786e4213cca9a6938dba5dacd64f87ec222
          ds_record: 12346 3 3 84763786e4213cca9a6938dba5dacd64f87ec216

        - name: iron01
          ds_key_tag: 5555
          ds_algorithm: 5
          ds_digest_type: 5
          ds_digest: 84763786e4213cca9a6938dba5dacd64f87ec222
          ds_record: 12343 3 3 84763786e4213cca9a6938dba5dacd64f87ec216
[root@client ~]# 
[root@client ~]# ansible-playbook test.yaml 

PLAY RECAP ***************************************************************************************************************************************
12.1.105.77                : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

[root@client ~]# ipa dnsrecord-show safezone.test iron01
  Record name: iron01
  A record: 12.1.105.77
  DS record: 12346 3 3 84763786e4213cca9a6938dba5dacd64f87ec216, 12343 3 3 84763786e4213cca9a6938dba5dacd64f87ec216, 5555 5 5
             84763786e4213cca9a6938dba5dacd64f87ec222
  NS record: iron01
[root@client ~]#

Comment 3 Rafael Jeffman 2020-11-13 18:39:00 UTC
In the example provided, the playbook should fail with message "`dsrecord` not found.", as it is modifying the same record twice, so in the second task the record does not exist anymore.

There is an upstream PR for the issue: https://github.com/freeipa/ansible-freeipa/pull/438

Comment 4 Rafael Jeffman 2020-11-20 12:34:56 UTC
Upstream PR was merged.

Comment 8 Varun Mylaraiah 2020-12-11 10:56:20 UTC
Verified:
ansible-freeipa-0.3.1-1.el8.noarch

2020-12-11T08:28:39+0000 ansible_freeipa_tests/dns_module.py::TestDNSDSrecord::test_dns_dsrec_update_multiple 
2020-12-11T08:28:39+0000 -------------------------------- live log call ---------------------------------
2020-12-11T08:28:39+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kinit', 'admin']
2020-12-11T08:28:39+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['ipa', 'dnsrecord-show', 'rectestzone.test', 'dnsrecord']
2020-12-11T08:28:40+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kdestroy', '-A']
2020-12-11T08:28:40+0000 [pytest_multihost.host.Host.ansible.ParamikoTransport] INFO WRITE inventory/dns.hosts
2020-12-11T08:28:40+0000 [pytest_multihost.host.Host.ansible.ParamikoTransport] INFO PUT dns_module.yml
2020-12-11T08:28:40+0000 [pytest_multihost.host.Host.ansible.ParamikoTransport] INFO RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/dns.hosts', 'dns_module.yml']
2020-12-11T08:28:46+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kinit', 'admin']
2020-12-11T08:28:46+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['ipa', 'dnsrecord-show', 'rectestzone.test', 'dnsrecord']
2020-12-11T08:28:47+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kdestroy', '-A']
2020-12-11T08:28:47+0000 [pytest_multihost.host.Host.ansible.ParamikoTransport] INFO RUN ['/usr/bin/rpm', '-q', 'ansible-freeipa']
2020-12-11T08:28:47+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kinit', 'admin']
2020-12-11T08:28:47+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['ipa', 'dnsrecord-show', 'rectestzone.test', 'dnsrecord']
2020-12-11T08:28:48+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kdestroy', '-A']
2020-12-11T08:28:49+0000 PASSED                                                                 


Based on the test result, marking the bug VERIFIED.

Comment 10 errata-xmlrpc 2021-05-18 15:51:18 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 (ansible-freeipa bug fix and enhancement update), 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/RHEA-2021:1860