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 1893685 - [ansible-freeipa] service members are removed while updating other members in role handling
Summary: [ansible-freeipa] service members are removed while updating other members in...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: ansible-freeipa
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Rafael Jeffman
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-02 11:02 UTC by Varun Mylaraiah
Modified: 2021-05-18 15:51 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 15:51:22 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Varun Mylaraiah 2020-11-02 11:02:56 UTC
Cloned: https://github.com/freeipa/ansible-freeipa/issues/413


Service members are removed while updating other members in the role handling

[root@master ~]# ipa role-show newrole
  Role name: newrole
  Member services: DNS/master.ipadomain.test, HTTP/master.ipadomain.test,
                   dogtag/master.ipadomain.test
[root@ansible ~]# cat newrole4.yaml
---
- name: "Add host member to the role"
  hosts: ipaserver

  tasks:
  - iparole:
      ipaadmin_password: <password>
      name: newrole
      host: testhost.ipadomain.test
      action: member

[root@ansible ~]# ansible-playbook -vv -i inventory/server.hosts newrole4.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: newrole4.yaml **********************************************************************************************
1 plays in newrole4.yaml

PLAY [Add host member to the role] ***********************************************************************************

TASK [Gathering Facts] ***********************************************************************************************
task path: /root/newrole4.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/newrole4.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=0  
[root@master ~]# ipa role-show newrole
  Role name: newrole
  Member hosts: testhost.ipadomain.test
Expected:
Should not remove service member while adding new members(user/group/host/host group)

Comment 2 Rafael Jeffman 2020-12-15 17:46:46 UTC
There is an upstream patch for this issue: https://github.com/freeipa/ansible-freeipa/pull/469

Comment 4 Rafael Jeffman 2021-01-07 14:17:25 UTC
Upstream PR was merged.

Comment 8 Varun Mylaraiah 2021-01-21 11:18:00 UTC
Verified

Version:
ansible-freeipa-0.3.2-1.el8.noarch
ipa-server-4.9.0-1.module+el8.4.0+9274+259c83ee.x86_64

Passed	ansible_freeipa_tests/rbac_module.py::TestRole::()::test_role_verify_service_not_removed_after_other_memberes_added
------------------------------ Captured log call -------------------------------
channel.py                1212 DEBUG    [chan 410] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 410] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 410 opened.
transport.py               318 INFO     RUN ['kinit', 'admin']
transport.py               519 DEBUG    RUN ['kinit', 'admin']
channel.py                1212 DEBUG    [chan 410] Sesch channel 410 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 410] EOF received (410)
channel.py                1212 DEBUG    [chan 410] EOF sent (410)
transport.py               217 DEBUG    Exit code: 0
channel.py                1212 DEBUG    [chan 411] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 411] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 411 opened.
transport.py               318 INFO     RUN ['ipa', 'role-show', 'test-service-role']
transport.py               519 DEBUG    RUN ['ipa', 'role-show', 'test-service-role']
channel.py                1212 DEBUG    [chan 411] Sesch channel 411 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      Role name: test-service-role
transport.py               563 DEBUG      Description: A role in IPA.
transport.py               563 DEBUG      Member services: newhost/master.ipadomain.test
channel.py                1212 DEBUG    [chan 411] EOF received (411)
channel.py                1212 DEBUG    [chan 411] EOF sent (411)
transport.py               217 DEBUG    Exit code: 0
channel.py                1212 DEBUG    [chan 412] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 412] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 412 opened.
transport.py               318 INFO     RUN ['kdestroy', '-A']
transport.py               519 DEBUG    RUN ['kdestroy', '-A']
channel.py                1212 DEBUG    [chan 412] Sesch channel 412 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 412] EOF received (412)
channel.py                1212 DEBUG    [chan 412] EOF sent (412)
transport.py               217 DEBUG    Exit code: 0
transport.py               293 INFO     WRITE inventory/rbac.hosts
sftp.py                    158 DEBUG    [chan 0] open(b'inventory/rbac.hosts', 'wb')
sftp.py                    158 DEBUG    [chan 0] open(b'inventory/rbac.hosts', 'wb') -> 00000000
sftp.py                    158 DEBUG    [chan 0] close(00000000)
transport.py               329 INFO     PUT rbac_module.yml
sftp.py                    158 DEBUG    [chan 0] open(b'rbac_module.yml', 'wb')
sftp.py                    158 DEBUG    [chan 0] open(b'rbac_module.yml', 'wb') -> 00000000
sftp.py                    158 DEBUG    [chan 0] close(00000000)
sftp.py                    158 DEBUG    [chan 0] stat(b'rbac_module.yml')
channel.py                1212 DEBUG    [chan 75] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 75] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 75 opened.
transport.py               318 INFO     RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/rbac.hosts', 'rbac_module.yml']
transport.py               519 DEBUG    RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/rbac.hosts', 'rbac_module.yml']
channel.py                1212 DEBUG    [chan 75] Sesch channel 75 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.17
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, Dec  7 2020, 09:56:35) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]
transport.py               563 DEBUG    Using /root/ansible.cfg as config file
transport.py               563 DEBUG    Skipping callback 'actionable', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'counter_enabled', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'debug', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'dense', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'dense', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'full_skip', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'json', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'minimal', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'null', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'oneline', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'selective', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'skippy', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'stderr', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'unixy', as we already have a stdout callback.
transport.py               563 DEBUG    Skipping callback 'yaml', as we already have a stdout callback.
transport.py               563 DEBUG    
transport.py               563 DEBUG    PLAYBOOK: rbac_module.yml ******************************************************
transport.py               563 DEBUG    1 plays in rbac_module.yml
transport.py               563 DEBUG    
transport.py               563 DEBUG    PLAY [Playbook to ensure service member is not removed from role after other members added.] ***
transport.py               563 DEBUG    
transport.py               563 DEBUG    TASK [Gathering Facts] *********************************************************
transport.py               563 DEBUG    task path: /root/rbac_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 [iparole] *****************************************************************
transport.py               563 DEBUG    task path: /root/rbac_module.yml:6
transport.py               563 DEBUG    changed: [master.ipadomain.test] => {"changed": true}
transport.py               563 DEBUG    META: ran handlers
transport.py               563 DEBUG    META: ran handlers
transport.py               563 DEBUG    
transport.py               563 DEBUG    PLAY RECAP *********************************************************************
transport.py               563 DEBUG    master.ipadomain.test      : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
transport.py               563 DEBUG    
channel.py                1212 DEBUG    [chan 75] EOF received (75)
channel.py                1212 DEBUG    [chan 75] EOF sent (75)
transport.py               217 DEBUG    Exit code: 0
channel.py                1212 DEBUG    [chan 413] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 413] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 413 opened.
transport.py               318 INFO     RUN ['kinit', 'admin']
transport.py               519 DEBUG    RUN ['kinit', 'admin']
channel.py                1212 DEBUG    [chan 413] Sesch channel 413 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 413] EOF received (413)
channel.py                1212 DEBUG    [chan 413] EOF sent (413)
transport.py               217 DEBUG    Exit code: 0
channel.py                1212 DEBUG    [chan 414] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 414] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 414 opened.
transport.py               318 INFO     RUN ['ipa', 'role-show', 'test-service-role']
transport.py               519 DEBUG    RUN ['ipa', 'role-show', 'test-service-role']
channel.py                1212 DEBUG    [chan 414] Sesch channel 414 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      Role name: test-service-role
transport.py               563 DEBUG      Description: A role in IPA.
transport.py               563 DEBUG      Member users: rbacuser01
transport.py               563 DEBUG      Member hosts: mytesthost2.ipadomain.test
transport.py               563 DEBUG      Member services: newhost/master.ipadomain.test
channel.py                1212 DEBUG    [chan 414] EOF received (414)
channel.py                1212 DEBUG    [chan 414] EOF sent (414)
transport.py               217 DEBUG    Exit code: 0
channel.py                1212 DEBUG    [chan 415] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 415] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 415 opened.
transport.py               318 INFO     RUN ['kdestroy', '-A']
transport.py               519 DEBUG    RUN ['kdestroy', '-A']
channel.py                1212 DEBUG    [chan 415] Sesch channel 415 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 415] EOF received (415)
channel.py                1212 DEBUG    [chan 415] EOF sent (415)
transport.py               217 DEBUG    Exit code: 0
channel.py                1212 DEBUG    [chan 416] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 416] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 416 opened.
transport.py               318 INFO     RUN ['kinit', 'admin']
transport.py               519 DEBUG    RUN ['kinit', 'admin']
channel.py                1212 DEBUG    [chan 416] Sesch channel 416 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 416] EOF received (416)
channel.py                1212 DEBUG    [chan 416] EOF sent (416)
transport.py               217 DEBUG    Exit code: 0
channel.py                1212 DEBUG    [chan 417] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 417] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 417 opened.
transport.py               318 INFO     RUN ['ipa', 'role-show', 'test-service-role']
transport.py               519 DEBUG    RUN ['ipa', 'role-show', 'test-service-role']
channel.py                1212 DEBUG    [chan 417] Sesch channel 417 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      Role name: test-service-role
transport.py               563 DEBUG      Description: A role in IPA.
transport.py               563 DEBUG      Member users: rbacuser01
transport.py               563 DEBUG      Member hosts: mytesthost2.ipadomain.test
transport.py               563 DEBUG      Member services: newhost/master.ipadomain.test
channel.py                1212 DEBUG    [chan 417] EOF received (417)
channel.py                1212 DEBUG    [chan 417] EOF sent (417)
transport.py               217 DEBUG    Exit code: 0
channel.py                1212 DEBUG    [chan 418] Max packet in: 32768 bytes
channel.py                1212 DEBUG    [chan 418] Max packet out: 32768 bytes
transport.py              1819 DEBUG    Secsh channel 418 opened.
transport.py               318 INFO     RUN ['kdestroy', '-A']
transport.py               519 DEBUG    RUN ['kdestroy', '-A']
channel.py                1212 DEBUG    [chan 418] Sesch channel 418 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 418] EOF received (418)
channel.py                1212 DEBUG    [chan 418] EOF sent (418)
transport.py               217 DEBUG    Exit code: 0

Comment 10 errata-xmlrpc 2021-05-18 15:51:22 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-2021:1860


Note You need to log in before you can comment on or make changes to this bug.