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 1999913

Summary: [ansible-freeipa] automember remove default group/hostgroup is missing from the automember module.
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: medium Docs Contact:
Priority: high    
Version: 8.5CC: rjeffman
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.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2021952 (view as bug list) Environment:
Last Closed: 2022-05-10 13:38:24 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: 2021952    

Description Varun Mylaraiah 2021-09-01 02:20:27 UTC
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-13 15:55:56 UTC
Verified
ansible-freeipa-1.5.3-1.el8

2022-01-13T12:36:32 ansible_freeipa_tests/automember/test_automember.py::TestAutomember::test_automember_remove_defaultgroup PASSED [ 82%]
2022-01-13T12:36:40 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_defaulthostgroup

2022-01-13T12:36:32+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['ipa', 'automember-default-group-set', '--default-group=defhostgroup', '--type=hostgroup']
2022-01-13T12:36:32+0000 [pytest_multihost.host.Host.master.cmd186] DEBUG RUN ['ipa', 'automember-default-group-set', '--default-group=defhostgroup', '--type=hostgroup']
2022-01-13T12:36:32+0000 [paramiko.transport] DEBUG [chan 185] Sesch channel 185 request ok
2022-01-13T12:36:32+0000 [pytest_multihost.host.Host.master.cmd186] DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-13T12:36:32+0000 [pytest_multihost.host.Host.master.cmd186] DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-13T12:36:33+0000 [pytest_multihost.host.Host.master.cmd186] DEBUG ipa: ERROR: no modifications to be performed
2022-01-13T12:36:33+0000 [paramiko.transport] DEBUG [chan 185] EOF received (185)
2022-01-13T12:36:33+0000 [paramiko.transport] DEBUG [chan 185] EOF sent (185)
2022-01-13T12:36:33+0000 [pytest_multihost.host.Host.master.cmd186] DEBUG Exit code: 1
2022-01-13T12:36:33+0000 [paramiko.transport] DEBUG [chan 186] Max packet in: 32768 bytes
2022-01-13T12:36:33+0000 [paramiko.transport] DEBUG [chan 186] Max packet out: 32768 bytes
2022-01-13T12:36:33+0000 [paramiko.transport] DEBUG Secsh channel 186 opened.
2022-01-13T12:36:33+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kinit', 'admin']
2022-01-13T12:36:33+0000 [pytest_multihost.host.Host.master.cmd187] DEBUG RUN ['kinit', 'admin']
2022-01-13T12:36:33+0000 [paramiko.transport] DEBUG [chan 186] Sesch channel 186 request ok
2022-01-13T12:36:33+0000 [pytest_multihost.host.Host.master.cmd187] DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-13T12:36:33+0000 [pytest_multihost.host.Host.master.cmd187] DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-13T12:36:33+0000 [pytest_multihost.host.Host.master.cmd187] DEBUG Password for admin: 
2022-01-13T12:36:33+0000 [paramiko.transport] DEBUG [chan 186] EOF received (186)
2022-01-13T12:36:33+0000 [paramiko.transport] DEBUG [chan 186] EOF sent (186)
2022-01-13T12:36:33+0000 [pytest_multihost.host.Host.master.cmd187] DEBUG Exit code: 0
2022-01-13T12:36:33+0000 [paramiko.transport] DEBUG [chan 187] Max packet in: 32768 bytes
2022-01-13T12:36:33+0000 [paramiko.transport] DEBUG [chan 187] Max packet out: 32768 bytes
2022-01-13T12:36:33+0000 [paramiko.transport] DEBUG Secsh channel 187 opened.
2022-01-13T12:36:33+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['ipa', 'automember-default-group-show', '--type=hostgroup']
2022-01-13T12:36:33+0000 [pytest_multihost.host.Host.master.cmd188] DEBUG RUN ['ipa', 'automember-default-group-show', '--type=hostgroup']
2022-01-13T12:36:33+0000 [paramiko.transport] DEBUG [chan 187] Sesch channel 187 request ok
2022-01-13T12:36:33+0000 [pytest_multihost.host.Host.master.cmd188] DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-13T12:36:33+0000 [pytest_multihost.host.Host.master.cmd188] DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.master.cmd188] DEBUG   Default (fallback) Group: cn=defhostgroup,cn=hostgroups,cn=accounts,dc=ipadomain,dc=test
2022-01-13T12:36:34+0000 [paramiko.transport] DEBUG [chan 187] EOF received (187)
2022-01-13T12:36:34+0000 [paramiko.transport] DEBUG [chan 187] EOF sent (187)
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.master.cmd188] DEBUG Exit code: 0
2022-01-13T12:36:34+0000 [paramiko.transport] DEBUG [chan 188] Max packet in: 32768 bytes
2022-01-13T12:36:34+0000 [paramiko.transport] DEBUG [chan 188] Max packet out: 32768 bytes
2022-01-13T12:36:34+0000 [paramiko.transport] DEBUG Secsh channel 188 opened.
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kdestroy', '-A']
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.master.cmd189] DEBUG RUN ['kdestroy', '-A']
2022-01-13T12:36:34+0000 [paramiko.transport] DEBUG [chan 188] Sesch channel 188 request ok
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.master.cmd189] DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.master.cmd189] DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-13T12:36:34+0000 [paramiko.transport] DEBUG [chan 188] EOF received (188)
2022-01-13T12:36:34+0000 [paramiko.transport] DEBUG [chan 188] EOF sent (188)
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.master.cmd189] DEBUG Exit code: 0
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.ParamikoTransport] INFO WRITE inventory/automember.hosts
2022-01-13T12:36:34+0000 [paramiko.transport.sftp] DEBUG [chan 0] open(b'inventory/automember.hosts', 'wb')
2022-01-13T12:36:34+0000 [paramiko.transport.sftp] DEBUG [chan 0] open(b'inventory/automember.hosts', 'wb') -> 00000000
2022-01-13T12:36:34+0000 [paramiko.transport.sftp] DEBUG [chan 0] close(00000000)
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.ParamikoTransport] INFO PUT automember_module.yml
2022-01-13T12:36:34+0000 [paramiko.transport.sftp] DEBUG [chan 0] open(b'automember_module.yml', 'wb')
2022-01-13T12:36:34+0000 [paramiko.transport.sftp] DEBUG [chan 0] open(b'automember_module.yml', 'wb') -> 00000000
2022-01-13T12:36:34+0000 [paramiko.transport.sftp] DEBUG [chan 0] close(00000000)
2022-01-13T12:36:34+0000 [paramiko.transport.sftp] DEBUG [chan 0] stat(b'automember_module.yml')
2022-01-13T12:36:34+0000 [paramiko.transport] DEBUG [chan 35] Max packet in: 32768 bytes
2022-01-13T12:36:34+0000 [paramiko.transport] DEBUG [chan 35] Max packet out: 32768 bytes
2022-01-13T12:36:34+0000 [paramiko.transport] DEBUG Secsh channel 35 opened.
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.ParamikoTransport] INFO RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/automember.hosts', 'automember_module.yml']
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/automember.hosts', 'automember_module.yml']
2022-01-13T12:36:34+0000 [paramiko.transport] DEBUG [chan 35] Sesch channel 35 request ok
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG ansible-playbook [core 2.12.1]
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG   config file = /etc/ansible/ansible.cfg
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG   configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG   ansible python module location = /usr/lib/python3.8/site-packages/ansible
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG   ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG   executable location = /usr/bin/ansible-playbook
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG   python version = 3.8.12 (default, Sep 16 2021, 10:46:05) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG   jinja version = 2.10.3
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG   libyaml = True
2022-01-13T12:36:34+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG Using /etc/ansible/ansible.cfg as config file
2022-01-13T12:36:35+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG Skipping callback 'default', as we already have a stdout callback.
2022-01-13T12:36:35+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG Skipping callback 'minimal', as we already have a stdout callback.
2022-01-13T12:36:35+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG Skipping callback 'oneline', as we already have a stdout callback.
2022-01-13T12:36:35+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG 
2022-01-13T12:36:35+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG PLAYBOOK: automember_module.yml ************************************************
2022-01-13T12:36:35+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG 1 plays in automember_module.yml
2022-01-13T12:36:35+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG 
2022-01-13T12:36:35+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG PLAY [Playbook to ensure automember default hostgroup is removed] **************
2022-01-13T12:36:35+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG 
2022-01-13T12:36:35+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG TASK [Gathering Facts] *********************************************************
2022-01-13T12:36:35+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG task path: /root/automember_module.yml:2
2022-01-13T12:36:36+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG ok: [master.ipadomain.test]
2022-01-13T12:36:36+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG META: ran handlers
2022-01-13T12:36:36+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG 
2022-01-13T12:36:36+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG TASK [ipaautomember] ***********************************************************
2022-01-13T12:36:36+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG task path: /root/automember_module.yml:7
2022-01-13T12:36:38+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG changed: [master.ipadomain.test] => {"changed": true}
2022-01-13T12:36:38+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG [WARNING]: commands: [[None, 'automember_default_group_remove', {'type':
2022-01-13T12:36:38+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG 'hostgroup'}]]
2022-01-13T12:36:38+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG META: ran handlers
2022-01-13T12:36:38+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG META: ran handlers
2022-01-13T12:36:38+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG 
2022-01-13T12:36:38+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG PLAY RECAP *********************************************************************
2022-01-13T12:36:38+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG master.ipadomain.test      : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
2022-01-13T12:36:38+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG 
2022-01-13T12:36:39+0000 [paramiko.transport] DEBUG [chan 35] EOF received (35)
2022-01-13T12:36:39+0000 [paramiko.transport] DEBUG [chan 35] EOF sent (35)
2022-01-13T12:36:39+0000 [pytest_multihost.host.Host.ansible.cmd35] DEBUG Exit code: 0
2022-01-13T12:36:39+0000 [paramiko.transport] DEBUG [chan 189] Max packet in: 32768 bytes
2022-01-13T12:36:39+0000 [paramiko.transport] DEBUG [chan 189] Max packet out: 32768 bytes
2022-01-13T12:36:39+0000 [paramiko.transport] DEBUG Secsh channel 189 opened.
2022-01-13T12:36:39+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kinit', 'admin']
2022-01-13T12:36:39+0000 [pytest_multihost.host.Host.master.cmd190] DEBUG RUN ['kinit', 'admin']
2022-01-13T12:36:39+0000 [paramiko.transport] DEBUG [chan 189] Sesch channel 189 request ok
2022-01-13T12:36:39+0000 [pytest_multihost.host.Host.master.cmd190] DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-13T12:36:39+0000 [pytest_multihost.host.Host.master.cmd190] DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-13T12:36:39+0000 [pytest_multihost.host.Host.master.cmd190] DEBUG Password for admin: 
2022-01-13T12:36:39+0000 [paramiko.transport] DEBUG [chan 189] EOF received (189)
2022-01-13T12:36:39+0000 [paramiko.transport] DEBUG [chan 189] EOF sent (189)
2022-01-13T12:36:39+0000 [pytest_multihost.host.Host.master.cmd190] DEBUG Exit code: 0
2022-01-13T12:36:39+0000 [paramiko.transport] DEBUG [chan 190] Max packet in: 32768 bytes
2022-01-13T12:36:39+0000 [paramiko.transport] DEBUG [chan 190] Max packet out: 32768 bytes
2022-01-13T12:36:39+0000 [paramiko.transport] DEBUG Secsh channel 190 opened.
2022-01-13T12:36:39+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['ipa', 'automember-default-group-show', '--type=hostgroup']
2022-01-13T12:36:39+0000 [pytest_multihost.host.Host.master.cmd191] DEBUG RUN ['ipa', 'automember-default-group-show', '--type=hostgroup']
2022-01-13T12:36:39+0000 [paramiko.transport] DEBUG [chan 190] Sesch channel 190 request ok
2022-01-13T12:36:39+0000 [pytest_multihost.host.Host.master.cmd191] DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-13T12:36:39+0000 [pytest_multihost.host.Host.master.cmd191] DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-13T12:36:39+0000 [pytest_multihost.host.Host.master.cmd191] DEBUG   Default (fallback) Group: No default (fallback) group set

Comment 9 errata-xmlrpc 2022-05-10 13:38:24 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-2022:1791