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 1999912

Summary: [ansible-freeipa] automember set 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: unspecified 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:
: 2021947 (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: 2021947    

Description Varun Mylaraiah 2021-09-01 02:19:03 UTC
Description of problem:
In the Ansible-freeipa Automember module, There is no option to set 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-set --help
Usage: ipa [global-options] automember-default-group-set [options]

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

Comment 6 Varun Mylaraiah 2022-01-13 15:52:53 UTC
Verified
ansible-freeipa-1.5.3-1.el8

2022-01-13T12:36:05 ansible_freeipa_tests/automember/test_automember.py::TestAutomember::test_automember_set_defaultgroup PASSED [ 71%]
2022-01-13T12:36:12 ansible_freeipa_tests/automember/test_automember.py::TestAutomember::test_automember_set_defaulthostgroup PASSED [ 74%]
2022-01-13T12:36:20 ansible_freeipa_tests/automember/test_automember.py::TestAutomember::test_automember_set_new_defaultgroup PASSED [ 76%]
2022-01-13T12:36:24 ansible_freeipa_tests/automember/test_automember.py::TestAutomember::test_automember_set_defaultgroup_for_nonexisting_group PASSED [ 79%]


Console-Output
===============
ansible_freeipa_tests/automember/test_automember.py::TestAutomember::test_automember_set_defaultgroup PASSED

2022-01-13T12:35:59+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['ipa', 'automember-default-group-show', '--type=group']
2022-01-13T12:35:59+0000 [pytest_multihost.host.Host.master.cmd158] DEBUG RUN ['ipa', 'automember-default-group-show', '--type=group']
2022-01-13T12:35:59+0000 [paramiko.transport] DEBUG [chan 157] Sesch channel 157 request ok
2022-01-13T12:35:59+0000 [pytest_multihost.host.Host.master.cmd158] DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-13T12:35:59+0000 [pytest_multihost.host.Host.master.cmd158] DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.master.cmd158] DEBUG   Default (fallback) Group: No default (fallback) group set
2022-01-13T12:36:00+0000 [paramiko.transport] DEBUG [chan 157] EOF received (157)
2022-01-13T12:36:00+0000 [paramiko.transport] DEBUG [chan 157] EOF sent (157)
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.master.cmd158] DEBUG Exit code: 0
2022-01-13T12:36:00+0000 [paramiko.transport] DEBUG [chan 158] Max packet in: 32768 bytes
2022-01-13T12:36:00+0000 [paramiko.transport] DEBUG [chan 158] Max packet out: 32768 bytes
2022-01-13T12:36:00+0000 [paramiko.transport] DEBUG Secsh channel 158 opened.
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kdestroy', '-A']
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.master.cmd159] DEBUG RUN ['kdestroy', '-A']
2022-01-13T12:36:00+0000 [paramiko.transport] DEBUG [chan 158] Sesch channel 158 request ok
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.master.cmd159] DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.master.cmd159] DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-13T12:36:00+0000 [paramiko.transport] DEBUG [chan 158] EOF received (158)
2022-01-13T12:36:00+0000 [paramiko.transport] DEBUG [chan 158] EOF sent (158)
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.master.cmd159] DEBUG Exit code: 0
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.ParamikoTransport] INFO WRITE inventory/automember.hosts
2022-01-13T12:36:00+0000 [paramiko.transport.sftp] DEBUG [chan 0] open(b'inventory/automember.hosts', 'wb')
2022-01-13T12:36:00+0000 [paramiko.transport.sftp] DEBUG [chan 0] open(b'inventory/automember.hosts', 'wb') -> 00000000
2022-01-13T12:36:00+0000 [paramiko.transport.sftp] DEBUG [chan 0] close(00000000)
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.ParamikoTransport] INFO PUT automember_module.yml
2022-01-13T12:36:00+0000 [paramiko.transport.sftp] DEBUG [chan 0] open(b'automember_module.yml', 'wb')
2022-01-13T12:36:00+0000 [paramiko.transport.sftp] DEBUG [chan 0] open(b'automember_module.yml', 'wb') -> 00000000
2022-01-13T12:36:00+0000 [paramiko.transport.sftp] DEBUG [chan 0] close(00000000)
2022-01-13T12:36:00+0000 [paramiko.transport.sftp] DEBUG [chan 0] stat(b'automember_module.yml')
2022-01-13T12:36:00+0000 [paramiko.transport] DEBUG [chan 30] Max packet in: 32768 bytes
2022-01-13T12:36:00+0000 [paramiko.transport] DEBUG [chan 30] Max packet out: 32768 bytes
2022-01-13T12:36:00+0000 [paramiko.transport] DEBUG Secsh channel 30 opened.
2022-01-13T12:36:00+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:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/automember.hosts', 'automember_module.yml']
2022-01-13T12:36:00+0000 [paramiko.transport] DEBUG [chan 30] Sesch channel 30 request ok
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG ansible-playbook [core 2.12.1]
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG   config file = /etc/ansible/ansible.cfg
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG   configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG   ansible python module location = /usr/lib/python3.8/site-packages/ansible
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG   ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG   executable location = /usr/bin/ansible-playbook
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] 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:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG   jinja version = 2.10.3
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG   libyaml = True
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG Using /etc/ansible/ansible.cfg as config file
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG Skipping callback 'default', as we already have a stdout callback.
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG Skipping callback 'minimal', as we already have a stdout callback.
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG Skipping callback 'oneline', as we already have a stdout callback.
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG 
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG PLAYBOOK: automember_module.yml ************************************************
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG 1 plays in automember_module.yml
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG 
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG PLAY [Playbook to ensure automember default group is set] **********************
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG 
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG TASK [Gathering Facts] *********************************************************
2022-01-13T12:36:00+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG task path: /root/automember_module.yml:2
2022-01-13T12:36:02+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG ok: [master.ipadomain.test]
2022-01-13T12:36:02+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG META: ran handlers
2022-01-13T12:36:02+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG 
2022-01-13T12:36:02+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG TASK [ipaautomember] ***********************************************************
2022-01-13T12:36:02+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG task path: /root/automember_module.yml:7
2022-01-13T12:36:04+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG changed: [master.ipadomain.test] => {"changed": true}
2022-01-13T12:36:04+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG META: ran handlers
2022-01-13T12:36:04+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG META: ran handlers
2022-01-13T12:36:04+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG 
2022-01-13T12:36:04+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG PLAY RECAP *********************************************************************
2022-01-13T12:36:04+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG master.ipadomain.test      : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
2022-01-13T12:36:04+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG 
2022-01-13T12:36:05+0000 [paramiko.transport] DEBUG [chan 30] EOF received (30)
2022-01-13T12:36:05+0000 [paramiko.transport] DEBUG [chan 30] EOF sent (30)
2022-01-13T12:36:05+0000 [pytest_multihost.host.Host.ansible.cmd30] DEBUG Exit code: 0
2022-01-13T12:36:05+0000 [paramiko.transport] DEBUG [chan 159] Max packet in: 32768 bytes
2022-01-13T12:36:05+0000 [paramiko.transport] DEBUG [chan 159] Max packet out: 32768 bytes
2022-01-13T12:36:05+0000 [paramiko.transport] DEBUG Secsh channel 159 opened.
2022-01-13T12:36:05+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['kinit', 'admin']
2022-01-13T12:36:05+0000 [pytest_multihost.host.Host.master.cmd160] DEBUG RUN ['kinit', 'admin']
2022-01-13T12:36:05+0000 [paramiko.transport] DEBUG [chan 159] Sesch channel 159 request ok
2022-01-13T12:36:05+0000 [pytest_multihost.host.Host.master.cmd160] DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-13T12:36:05+0000 [pytest_multihost.host.Host.master.cmd160] DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-13T12:36:05+0000 [pytest_multihost.host.Host.master.cmd160] DEBUG Password for admin: 
2022-01-13T12:36:05+0000 [paramiko.transport] DEBUG [chan 159] EOF received (159)
2022-01-13T12:36:05+0000 [paramiko.transport] DEBUG [chan 159] EOF sent (159)
2022-01-13T12:36:05+0000 [pytest_multihost.host.Host.master.cmd160] DEBUG Exit code: 0
2022-01-13T12:36:05+0000 [paramiko.transport] DEBUG [chan 160] Max packet in: 32768 bytes
2022-01-13T12:36:05+0000 [paramiko.transport] DEBUG [chan 160] Max packet out: 32768 bytes
2022-01-13T12:36:05+0000 [paramiko.transport] DEBUG Secsh channel 160 opened.
2022-01-13T12:36:05+0000 [pytest_multihost.host.Host.master.ParamikoTransport] INFO RUN ['ipa', 'automember-default-group-show', '--type=group']
2022-01-13T12:36:05+0000 [pytest_multihost.host.Host.master.cmd161] DEBUG RUN ['ipa', 'automember-default-group-show', '--type=group']
2022-01-13T12:36:05+0000 [paramiko.transport] DEBUG [chan 160] Sesch channel 160 request ok
2022-01-13T12:36:05+0000 [pytest_multihost.host.Host.master.cmd161] DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
2022-01-13T12:36:05+0000 [pytest_multihost.host.Host.master.cmd161] DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
2022-01-13T12:36:05+0000 [pytest_multihost.host.Host.master.cmd161] DEBUG   Default (fallback) Group: cn=defgroup,cn=groups,cn=accounts,dc=ipadomain,dc=test

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