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 2021952

Summary: [ansible-freeipa] automember remove default group/hostgroup is missing from the automember module.
Product: Red Hat Enterprise Linux 9 Reporter: Varun Mylaraiah <mvarun>
Component: ansible-freeipaAssignee: Thomas Woerner <twoerner>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: medium Docs Contact:
Priority: high    
Version: 9.0CC: ipa-qe, rjeffman, twoerner
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ansible-freeipa-1.5.3-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1999913 Environment:
Last Closed: 2022-05-17 12:47: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:
Bug Depends On: 1999913    
Bug Blocks:    

Description Varun Mylaraiah 2021-11-10 13:23:47 UTC
+++ This bug was initially created as a clone of Bug #1999913 +++

Description of problem:
In the Ansible-freeipa Automember module, There is no option to remove a default group/hostgroup. 

Version-Release number of selected component (if applicable):
ansible-freeipa-0.3.8-1

Expected results:
CLI option.
# ipa automember-default-group-remove --help
Usage: ipa [global-options] automember-default-group-remove [options]

Remove default (fallback) group for all unmatched entries.
Options:
--desc=STR            A description of this auto member rule
--type=['group', 'hostgroup'] Grouping to which the rule applies

Comment 5 Varun Mylaraiah 2022-01-17 06:02:59 UTC
Verified
ansible-freeipa-1.5.3-1.el9
ansible-core-2.12.1-1.el9


2022-01-15T14:57:50 ansible_freeipa_tests/automember/test_automember.py::TestAutomember::test_automember_remove_defaultgroup PASSED [ 82%]
2022-01-15T14:57:59 ansible_freeipa_tests/automember/test_automember.py::TestAutomember::test_automember_remove_defaulthostgroup PASSED [ 84%]


==============
Console-Output
==============

ansible_freeipa_tests/automember/test_automember.py::TestAutomember::test_automember_remove_defaultgroup


2022-01-15T14:57:41+0000 [pytest_multihost.host.Host.master.OpenSSHTransport] INFO RUN ['ipa', 'automember-default-group-show', '--type=group']
2022-01-15T14:57:41+0000 [pytest_multihost.host.Host.master.cmd181] DEBUG RUN ['ipa', 'automember-default-group-show', '--type=group']
2022-01-15T14:57:42+0000 [pytest_multihost.host.Host.master.cmd181] DEBUG bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-15T14:57:42+0000 [pytest_multihost.host.Host.master.cmd181] DEBUG bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-15T14:57:42+0000 [pytest_multihost.host.Host.master.cmd181] DEBUG   Default (fallback) Group: cn=defgroup,cn=groups,cn=accounts,dc=ipadomain,dc=test
2022-01-15T14:57:42+0000 [pytest_multihost.host.Host.master.cmd181] DEBUG Exit code: 0
2022-01-15T14:57:42+0000 [pytest_multihost.host.Host.master.OpenSSHTransport] INFO RUN ['kdestroy', '-A']
2022-01-15T14:57:42+0000 [pytest_multihost.host.Host.master.cmd182] DEBUG RUN ['kdestroy', '-A']
2022-01-15T14:57:42+0000 [pytest_multihost.host.Host.master.cmd182] DEBUG bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-15T14:57:42+0000 [pytest_multihost.host.Host.master.cmd182] DEBUG bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.master.cmd182] DEBUG Exit code: 0
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.OpenSSHTransport] INFO PUT inventory/automember.hosts
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd99] DEBUG RUN ['tee', 'inventory/automember.hosts']
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd99] DEBUG Exit code: 0
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.OpenSSHTransport] INFO PUT automember_module.yml
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd100] DEBUG RUN ['tee', 'automember_module.yml']
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd100] DEBUG Exit code: 0
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.OpenSSHTransport] INFO RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/automember.hosts', 'automember_module.yml']
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/automember.hosts', 'automember_module.yml']
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG ansible-playbook [core 2.12.1]
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG   config file = /etc/ansible/ansible.cfg
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG   configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG   ansible python module location = /usr/lib/python3.9/site-packages/ansible
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG   ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG   executable location = /usr/bin/ansible-playbook
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG   python version = 3.9.9 (main, Nov 22 2021, 00:00:00) [GCC 11.2.1 20211019 (Red Hat 11.2.1-6)]
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG   jinja version = 2.11.3
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG   libyaml = True
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG Using /etc/ansible/ansible.cfg as config file
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG Skipping callback 'default', as we already have a stdout callback.
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG Skipping callback 'minimal', as we already have a stdout callback.
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG Skipping callback 'oneline', as we already have a stdout callback.
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG 
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG PLAYBOOK: automember_module.yml ************************************************
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG 1 plays in automember_module.yml
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG 
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG PLAY [Playbook to ensure automember default group is removed] ******************
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG 
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG TASK [Gathering Facts] *********************************************************
2022-01-15T14:57:43+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG task path: /root/automember_module.yml:2
2022-01-15T14:57:45+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG ok: [master.ipadomain.test]
2022-01-15T14:57:45+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG META: ran handlers
2022-01-15T14:57:45+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG 
2022-01-15T14:57:45+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG TASK [ipaautomember] ***********************************************************
2022-01-15T14:57:45+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG task path: /root/automember_module.yml:7
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG [WARNING]: commands: [[None, 'automember_default_group_remove', {'type':
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG changed: [master.ipadomain.test] => {"changed": true}
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG 'group'}]]
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG META: ran handlers
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG META: ran handlers
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG 
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG PLAY RECAP *********************************************************************
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG master.ipadomain.test      : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG 
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.ansible.cmd101] DEBUG Exit code: 0
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.master.OpenSSHTransport] INFO RUN ['kinit', 'admin']
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.master.cmd183] DEBUG RUN ['kinit', 'admin']
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.master.cmd183] DEBUG bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.master.cmd183] DEBUG bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.master.cmd183] DEBUG Password for admin: 
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.master.cmd183] DEBUG Exit code: 0
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.master.OpenSSHTransport] INFO RUN ['ipa', 'automember-default-group-show', '--type=group']
2022-01-15T14:57:48+0000 [pytest_multihost.host.Host.master.cmd184] DEBUG RUN ['ipa', 'automember-default-group-show', '--type=group']

Comment 9 errata-xmlrpc 2022-05-17 12:47:27 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 (new packages: ansible-freeipa), 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-2022:2395