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 1976923

Summary: [ansible-freeipa] Required better error message for updating in/ex/clusive regex to non-existent automember rule
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.5CC: amore
Target Milestone: betaKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ansible-freeipa-0.3.7-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1981711 (view as bug list) Environment:
Last Closed: 2021-11-09 18:45:36 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:
Bug Depends On:    
Bug Blocks: 1981711    

Description Varun Mylaraiah 2021-06-28 15:00:50 UTC
Description of problem:
Required better error message for updating in/ex/clusive regex to non-existent automember rule

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


Steps to Reproduce:
[root@ansible ~]# cat automember2.yaml
---
- name: Playbook to ensure not able to update exclusive regex to non-existent automember group rule.
  hosts: ipaserver
  become: yes
  
  tasks:
  - ipaautomember:      
      ipaadmin_principal: admin
      ipaadmin_password:<xxxxxxx>
      name: noautomemb_usergroup
      exclusive:
        - key: cn
          expression: '^uid=clint'
      action: member
      automember_type: group


[root@ansible ~]# ansible-playbook -vv -i inventory/automember.hosts automember2.yaml
PLAYBOOK: automember2.yaml ************************************************************************************************
1 plays in automember2.yaml

PLAY [Playbook to ensure not able to update exclusive regex to non-existent automember group rule.] ***********************

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

TASK [ipaautomember] ******************************************************************************************************
task path: /root/automember2.yaml:7
fatal: [master.ipadomain.test]: FAILED! => {"changed": false, "msg": "No service 'noautomemb_usergroup'"}

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

Actual results:
 FAILED! => {"changed": false, "msg": "No service 'noautomemb_usergroup'"}

Expected results:
Auto member rule: onautomemb_usergroup not found

Additional info:
[root@master ~]# ipa automember-add-condition noautomemb_usergroup --key=cn --exclusive-regex=^uid=clint --type=group
ipa: ERROR: Auto member rule: noautomemb_usergroup not found

Comment 1 Thomas Woerner 2021-07-08 13:30:20 UTC
Here is the upstream PR: https://github.com/freeipa/ansible-freeipa/pull/584

It has been merged.

Comment 6 anuja 2021-07-30 12:21:48 UTC
Verified using nightly:
(A) test-result.txt.gz
2021-07-30T12:07:03 ============================= test session starts ==============================
2021-07-30T12:15:41 ansible_freeipa_tests/automember/test_automember.py::TestAutomember::test_automember_nonexisting_group_rule_update_exclusive_regex PASSED [ 57%]

(B) runner.log 
2021-07-30T12:06:58 ok: [ansible.runner.test] => (item=ansible-freeipa) => 
2021-07-30T12:06:58   msg:
2021-07-30T12:06:58   - arch: noarch
2021-07-30T12:06:58     epoch: null
2021-07-30T12:06:58     name: ansible-freeipa
2021-07-30T12:06:58     release: 1.el8
2021-07-30T12:06:58     source: rpm
2021-07-30T12:06:58     version: 0.3.8

Comment 9 errata-xmlrpc 2021-11-09 18:45:36 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/RHBA-2021:4268