Bug 1848426

Summary: [ansible-freeipa] Required error message for adding the non-existing users/groups as a Hostgroup member manager
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.3Flags: pm-rhel: mirror+
Target Milestone: rc   
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ansible-freeipa-0.1.12-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 02:46:57 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-06-18 11:12:04 UTC
Description of problem:
Required error message for adding the non-existing users/groups as a Hostgroup member manager.

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

Steps to Reproduce:
[root@master ~]# ipa hostgroup-show hostgmgroup
  Host-group: hostgmgroup
[root@master ~]# 

[root@ansible ~]# cat hgmm02.yaml 
---
- name: Test membermanager
  hosts: ipaserver

  tasks:
  - name: ensure hostgroup membermanager test
    ipahostgroup:
      ipaadmin_password: <xxxxxxxx>
      name: hostgmgroup
      membermanager_user: nouser
      action: member

[root@ansible ~]# ansible-playbook -i inventory/service.hosts -vv hgmm02.yaml
ansible-playbook 2.9.9
  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.6/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 3.6.8 (default, Apr  3 2020, 16:09:51) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
Using /root/ansible.cfg as config file

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

PLAY [Test membermanager] ****************************************************************************************************

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

TASK [ensure hostgroup membermanager test] ***********************************************************************************
task path: /root/hgmm02.yaml:6
ok: [master.ipadomain.test] => {"changed": false}
META: ran handlers
META: ran handlers

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

[root@master ~]# ipa hostgroup-show hostgmgroup
  Host-group: hostgmgroup



Expected results:
fatal: [master.ipadomain.test]: FAILED! => {"changed": false, "msg": "hostgroup_add_member_manager: user nouser: no such entry"}

Comment 2 Thomas Woerner 2020-06-29 11:20:41 UTC
Here is the upstream PR: https://github.com/freeipa/ansible-freeipa/pull/309

Comment 3 Thomas Woerner 2020-06-29 13:57:21 UTC
The upstream PR has been merged.

Comment 9 Varun Mylaraiah 2020-08-05 12:14:35 UTC
Verified

ansible-freeipa-0.1.12-5.el8.noarch

Automation test result:
ansible-freeipa-tests/ansible_freeipa_tests/host_module.py::TestHostGroupMemberMangement::()::test_add_nonexisting_user_as_hostgroup_member_manager
------------------------------ Captured log call -------------------------------
channel.py                1212 DEBUG    [chan 311] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 311] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 311 opened.
transport.py               318 INFO     RUN ['ipactl', 'status']
transport.py               519 DEBUG    RUN ['ipactl', 'status']
channel.py                1212 DEBUG    [chan 311] Sesch channel 311 request ok
transport.py               563 DEBUG    -bash: line 1: cd: /root/multihost_tests: No such file or directory
transport.py               563 DEBUG    -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
transport.py               563 DEBUG    Directory Service: RUNNING
transport.py               563 DEBUG    krb5kdc Service: RUNNING
transport.py               563 DEBUG    kadmin Service: RUNNING
transport.py               563 DEBUG    named Service: RUNNING
transport.py               563 DEBUG    httpd Service: RUNNING
transport.py               563 DEBUG    ipa-custodia Service: RUNNING
transport.py               563 DEBUG    pki-tomcatd Service: RUNNING
transport.py               563 DEBUG    ipa-otpd Service: RUNNING
transport.py               563 DEBUG    ipa-dnskeysyncd Service: RUNNING
transport.py               563 DEBUG    ipa: INFO: The ipactl command was successful
channel.py                1212 DEBUG    [chan 311] EOF received (311)
channel.py                1212 DEBUG    [chan 311] EOF sent (311)
transport.py               217 DEBUG    Exit code: 0
transport.py               293 INFO     WRITE inventory/host.hosts
sftp.py                    158 DEBUG    [chan 0] open(b'inventory/host.hosts', 'wb')
sftp.py                    158 DEBUG    [chan 0] open(b'inventory/host.hosts', 'wb') -> 00000000
sftp.py                    158 DEBUG    [chan 0] close(00000000)
transport.py               329 INFO     PUT host_module.yml
sftp.py                    158 DEBUG    [chan 0] open(b'host_module.yml', 'wb')
sftp.py                    158 DEBUG    [chan 0] open(b'host_module.yml', 'wb') -> 00000000
sftp.py                    158 DEBUG    [chan 0] close(00000000)
sftp.py                    158 DEBUG    [chan 0] stat(b'host_module.yml')
channel.py                1212 DEBUG    [chan 49] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 49] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 49 opened.
transport.py               318 INFO     RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/host.hosts', 'host_module.yml']
transport.py               519 DEBUG    RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/host.hosts', 'host_module.yml']
channel.py                1212 DEBUG    [chan 49] Sesch channel 49 request ok
transport.py               563 DEBUG    -bash: line 1: cd: /root/multihost_tests: No such file or directory
transport.py               563 DEBUG    -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
transport.py               563 DEBUG    ansible-playbook 2.9.11
transport.py               563 DEBUG      config file = /root/ansible.cfg
transport.py               563 DEBUG      configured module search path = ['/root/ansible-freeipa/plugins/modules', '/usr/share/ansible/plugins/modules']
transport.py               563 DEBUG      ansible python module location = /usr/lib/python3.6/site-packages/ansible
transport.py               563 DEBUG      executable location = /usr/bin/ansible-playbook
transport.py               563 DEBUG      python version = 3.6.8 (default, Jun 26 2020, 12:10:09) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
transport.py               563 DEBUG    Using /root/ansible.cfg as config file
transport.py               563 DEBUG    
transport.py               563 DEBUG    PLAYBOOK: host_module.yml ******************************************************
transport.py               563 DEBUG    1 plays in host_module.yml
transport.py               563 DEBUG    
transport.py               563 DEBUG    PLAY [Playbook to ensure error is present while adding nonexisting user and group as a group member manager] ***
transport.py               563 DEBUG    
transport.py               563 DEBUG    TASK [Gathering Facts] *********************************************************
transport.py               563 DEBUG    task path: /root/host_module.yml:2
transport.py               563 DEBUG    ok: [master.ipadomain.test]
transport.py               563 DEBUG    META: ran handlers
transport.py               563 DEBUG    
transport.py               563 DEBUG    TASK [ipahostgroup] ************************************************************
transport.py               563 DEBUG    task path: /root/host_module.yml:7
transport.py               563 DEBUG    changed: [master.ipadomain.test] => {"changed": true}
transport.py               563 DEBUG    
transport.py               563 DEBUG    TASK [ipahostgroup] ************************************************************
transport.py               563 DEBUG    task path: /root/host_module.yml:13
transport.py               563 DEBUG    fatal: [master.ipadomain.test]: FAILED! => {"changed": false, "msg": "hostgroup_add_member_manager: user nouser: no such entry"}
transport.py               563 DEBUG    
transport.py               563 DEBUG    PLAY RECAP *********************************************************************
transport.py               563 DEBUG    master.ipadomain.test      : ok=2    changed=1    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
transport.py               563 DEBUG    
channel.py                1212 DEBUG    [chan 49] EOF received (49)
channel.py                1212 DEBUG    [chan 49] EOF sent (49)
transport.py               217 DEBUG    Exit code: 2
channel.py                1212 DEBUG    [chan 312] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 312] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 312 opened.
transport.py               318 INFO     RUN ['kinit', 'admin']
transport.py               519 DEBUG    RUN ['kinit', 'admin']
channel.py                1212 DEBUG    [chan 312] Sesch channel 312 request ok
transport.py               563 DEBUG    -bash: line 1: cd: /root/multihost_tests: No such file or directory
transport.py               563 DEBUG    -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
transport.py               563 DEBUG    Password for admin: 
channel.py                1212 DEBUG    [chan 312] EOF received (312)
channel.py                1212 DEBUG    [chan 312] EOF sent (312)
transport.py               217 DEBUG    Exit code: 0
channel.py                1212 DEBUG    [chan 313] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 313] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 313 opened.
transport.py               318 INFO     RUN ['ipa', 'hostgroup-show', 'myhostgroupmanager01']
transport.py               519 DEBUG    RUN ['ipa', 'hostgroup-show', 'myhostgroupmanager01']
channel.py                1212 DEBUG    [chan 313] Sesch channel 313 request ok
transport.py               563 DEBUG    -bash: line 1: cd: /root/multihost_tests: No such file or directory
transport.py               563 DEBUG    -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
transport.py               563 DEBUG      Host-group: myhostgroupmanager01
transport.py               563 DEBUG      Description: Example host group
channel.py                1212 DEBUG    [chan 313] EOF received (313)
channel.py                1212 DEBUG    [chan 313] EOF sent (313)
transport.py               217 DEBUG    Exit code: 0
channel.py                1212 DEBUG    [chan 314] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 314] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 314 opened.
transport.py               318 INFO     RUN ['kdestroy', '-A']
transport.py               519 DEBUG    RUN ['kdestroy', '-A']
channel.py                1212 DEBUG    [chan 314] Sesch channel 314 request ok
transport.py               563 DEBUG    -bash: line 1: cd: /root/multihost_tests: No such file or directory
transport.py               563 DEBUG    -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
channel.py                1212 DEBUG    [chan 314] EOF received (314)
channel.py                1212 DEBUG    [chan 314] EOF sent (314)
transport.py               217 DEBUG    Exit code: 0

Comment 12 errata-xmlrpc 2020-11-04 02:46:57 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-2020:4663