Bug 1893683

Summary: [ansible-freeipa] Required error message while adding non-existing members in role handling
Product: Red Hat Enterprise Linux 8 Reporter: Varun Mylaraiah <mvarun>
Component: ansible-freeipaAssignee: Thomas Woerner <twoerner>
Status: CLOSED DUPLICATE QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.4   
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-10 13:06:27 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 2020-11-02 11:00:34 UTC
Cloned: https://github.com/freeipa/ansible-freeipa/issues/411

There is no error message while adding non-existing members(user/group/host/host group/service) in the role and also it removed existing member as well

[root@master ~]# ipa role-show newrole
  Role name: newrole
  Member users: vuser01
  Member groups: vgroup01
  Member hosts: teshoat.ipadomain.test
  Member host-groups: hostgroup01
  Privileges: User Administrators, Group Administrators, Host Administrators, DNS Administrators, DNS Servers
  Member services: newhost1/master.ipadomain.test
[root@ansible ~]# cat newrole2.yaml
---
- name: "nonexisting user as a member"
  hosts: ipaserver

  tasks:
  - iparole:
      ipaadmin_password: <password>
      name: newrole
      user: nouser
      action: member

[root@ansible ~]# ansible-playbook -vv -i inventory/server.hosts newrole2.yaml 
ansible-playbook 2.9.11
  config file = /root/ansible.cfg
  configured module search path = ['/root/ansible-freeipa/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.8/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 3.8.5 (default, Aug 12 2020, 00:00:00) [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)]
Using /root/ansible.cfg as config file

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

PLAY [nonexisting user as a member] **********************************************************************************

TASK [Gathering Facts] ***********************************************************************************************
task path: /root/newrole2.yaml:2
[DEPRECATION WARNING]: Distribution fedora 32 on host master.ipadomain.test should use /usr/bin/python3, but is using
 /usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible release will default to 
using the discovered platform python for this host. See 
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information. This 
feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False 
in ansible.cfg.
ok: [master.ipadomain.test]
META: ran handlers

TASK [iparole] *******************************************************************************************************
task path: /root/newrole2.yaml:6
changed: [master.ipadomain.test] => {"changed": true}
META: ran handlers
META: ran handlers

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

Comment 1 Varun Mylaraiah 2020-11-10 13:06:27 UTC

*** This bug has been marked as a duplicate of bug 1893679 ***