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 1780325

Summary: No error message on user adding in a group which does not exists
Product: Red Hat Enterprise Linux 8 Reporter: Kaleem <ksiddiqu>
Component: ansible-freeipaAssignee: Thomas Woerner <twoerner>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1CC: mvarun, ndehadra
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ansible-freeipa-0.1.8-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:01:56 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 Kaleem 2019-12-05 17:15:04 UTC
Description of problem:

playbook for addition of non-existent user in group does not report any error in output.

Version-Release number of selected component (if applicable):
[root@master ~]# rpm -q ipa-server ansible-freeipa
ipa-server-4.8.0-11.module+el8.1.0+4247+9f3fd721.x86_64
ansible-freeipa-0.1.6-4.el8.noarch
[root@master ~]# 

How reproducible:
Always

Steps to Reproduce:
1. Try to add a non-existent user in a group using ansible playbook

Actual results:
No error shown in console output

Expected results:
An error should have been shown in console output

Additional info:
Please find the attached file for steps and console output for this bug.

Comment 3 Thomas Woerner 2019-12-18 13:23:08 UTC
This has already been fixed with the ipauser extension https://github.com/freeipa/ansible-freeipa/commit/40713e71f96568cbebec44bf034dc72f90f46cd2
It is part of ansible-freeipa-0.1.7+.

Comment 4 Thomas Woerner 2019-12-18 13:31:19 UTC
(In reply to Thomas Woerner from comment #3)
> This has already been fixed with the ipauser extension
> https://github.com/freeipa/ansible-freeipa/commit/
> 40713e71f96568cbebec44bf034dc72f90f46cd2
> It is part of ansible-freeipa-0.1.7+.

This has been fixed in the ipagroup rework: https://github.com/freeipa/ansible-freeipa/commit/c5e0b1b4532261dd41604cc6320d18de2ac07217

Comment 6 Varun Mylaraiah 2020-02-13 12:11:19 UTC
Verified 
ansible-freeipa-0.1.8-1.el8.noarch

[root@master ~]# ipa user-find | grep User
  User login: admin
[root@master ~]# ipa group-show testgroup01
  Group name: testgroup01
  GID: 1994600001


cat add_nonexisting_member_to_the_group.yaml
---
- name: Playbook to handle group member
  hosts: ipaserver
  become: true

  tasks:
  # add non-existent group member
  - ipagroup:
      ipaadmin_password: <xxxxxxx>
      name: testgroup01
      action: member
      user: notestuser01
      
# ansible-playbook -vv -i inventory/server.hosts add_nonexisting_member_to_the_group.yaml 
ansible-playbook 2.9.4
  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: add_nonexisting_member_to_the_group.yaml *******************************************************************
1 plays in add_nonexisting_member_to_the_group.yaml

PLAY [Playbook to handle group member] *******************************************************************************

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

TASK [ipagroup] ******************************************************************************************************
task path: /root/add_nonexisting_member_to_the_group.yaml:8
fatal: [master.ipadomain.test]: FAILED! => {"changed": false, "msg": "group_add_member: user notestuser01: no such entry"}

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


Now, the error message appears while adding non-existing user members to the group.
Based on the test result, marking the bug VERIFIED

Comment 9 errata-xmlrpc 2020-04-28 16:01:56 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