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 2150334 - [ansible-freeipa] Not able to reset the maxrepeat in the pwpolicy module
Summary: [ansible-freeipa] Not able to reset the maxrepeat in the pwpolicy module
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: ansible-freeipa
Version: 9.2
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Rafael Jeffman
QA Contact: Varun Mylaraiah
URL:
Whiteboard:
Depends On: 2150332
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-02 14:27 UTC by Varun Mylaraiah
Modified: 2023-05-09 08:04 UTC (History)
4 users (show)

Fixed In Version: ansible-freeipa-1.9.1-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2150332
Environment:
Last Closed: 2023-05-09 07:25:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-9111 0 None None None 2022-12-02 14:30:03 UTC
Red Hat Issue Tracker RHELPLAN-141196 0 None None None 2022-12-02 14:30:09 UTC
Red Hat Product Errata RHEA-2023:2168 0 None None None 2023-05-09 07:26:05 UTC

Description Varun Mylaraiah 2022-12-02 14:27:23 UTC
+++ This bug was initially created as a clone of Bug #2150332 +++

Description of problem:
Not able to reset the maxrepeat in the ansible-freeipa pwpolicy module.


How reproducible:


Steps to Reproduce:
# cat pwpolicy_module.yml
---
- name: Playbook to ensure maxrepeat reset.
  hosts: ipaserver
  become: true

  tasks:
  - ipapwpolicy:
      ipaadmin_password: <xxxxxxx>
      name: 10newpolicygroup
      maxrepeat: ""

PLAY [Playbook to ensure maxrepeat reset.] ********************************************************************

TASK [Gathering Facts] ****************************************************************************************
task path: /root/pwpolicy_module.yml:2
ok: [master.ipadomain.test]

TASK [ipapwpolicy] ********************************************************************************************
task path: /root/pwpolicy_module.yml:7
fatal: [master.ipadomain.test]: FAILED! => {"changed": false, "msg": "argument 'maxrepeat' is of type <class 'str'> and we were unable to convert to int: <class 'str'> cannot be converted to an int"}

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

Actual results:
FAILED! => {"changed": false, "msg": "argument 'maxrepeat' is of type <class 'str'> and we were unable to convert to int: <class 'str'> cannot be converted to an int"}

Expected results:
pwpolicy maxreset should work with the reset.

Additional info:
[root@master ~]# ipa pwpolicy-show global_policy
  Group: global_policy
  Max lifetime (days): 90
  Min lifetime (hours): 1
  History size: 0
  Character classes: 0
  Min length: 8
  Max failures: 6
  Failure reset interval: 60
  Lockout duration: 600
  Max repeat: 100
  Grace login limit: -1


[root@master ~]# ipa pwpolicy-mod global_policy --maxrepeat=
  Group: global_policy
  Max lifetime (days): 90
  Min lifetime (hours): 1
  History size: 0
  Character classes: 0
  Min length: 8
  Max failures: 6
  Failure reset interval: 60
  Lockout duration: 600
  Grace login limit: -1

Comment 1 Rafael Jeffman 2022-12-02 17:45:13 UTC
Changing DTM/ITM back to 22/24 as the fix for this issue will require more changes as nearly all fields can be cleared with an empty string on CLI. The only field that failed to clear is 'minlength'.

Comment 2 Rafael Jeffman 2023-01-04 22:09:44 UTC
Upstream PR: https://github.com/freeipa/ansible-freeipa/pull/1012

Comment 3 Rafael Jeffman 2023-01-05 13:42:59 UTC
Upstream PR has been merged.

Comment 4 Rafael Jeffman 2023-01-05 19:04:26 UTC
Sorry, marked the wrong PR as merged.

Marking BZ back to "ASSIGNED".

Comment 5 Rafael Jeffman 2023-01-13 22:45:42 UTC
Upstream PR has been merged.

Comment 9 Varun Mylaraiah 2023-02-07 06:46:38 UTC
Verified 
ansible-core-2.14.2-3.el9.x86_64
ansible-freeipa-1.9.2-1.el9.noarch

Passed	ansible_freeipa_tests/pwpolicy/test_pwpolicy.py::Testpwpolicy::test_pwpolicy_update_maxrepeat_reset


INFO     pytest_multihost.host.Host.master.OpenSSHTransport:transport.py:397 RUN ['ipa', 'pwpolicy-add', '10newpolicygroup', '--priority=14', '--maxrepeat=14']
DEBUG    pytest_multihost.host.Host.master.cmd92:transport.py:519 RUN ['ipa', 'pwpolicy-add', '10newpolicygroup', '--priority=14', '--maxrepeat=14']
DEBUG    pytest_multihost.host.Host.master.cmd92:transport.py:563 bash: line 1: cd: /root/multihost_tests: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd92:transport.py:563 bash: line 2: /root/multihost_tests/env.sh: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd92:transport.py:563   Group: 10newpolicygroup
DEBUG    pytest_multihost.host.Host.master.cmd92:transport.py:563   Priority: 14
DEBUG    pytest_multihost.host.Host.master.cmd92:transport.py:563   Max repeat: 14
DEBUG    pytest_multihost.host.Host.master.cmd92:transport.py:563   Grace login limit: -1
DEBUG    pytest_multihost.host.Host.master.cmd92:transport.py:217 Exit code: 0
INFO     pytest_multihost.host.Host.master.OpenSSHTransport:transport.py:397 RUN ['kinit', 'admin']
DEBUG    pytest_multihost.host.Host.master.cmd93:transport.py:519 RUN ['kinit', 'admin']
DEBUG    pytest_multihost.host.Host.master.cmd93:transport.py:563 bash: line 1: cd: /root/multihost_tests: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd93:transport.py:563 bash: line 2: /root/multihost_tests/env.sh: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd93:transport.py:563 Password for admin: 
DEBUG    pytest_multihost.host.Host.master.cmd93:transport.py:217 Exit code: 0
INFO     pytest_multihost.host.Host.master.OpenSSHTransport:transport.py:397 RUN ['ipa', 'pwpolicy-find', '10newpolicygroup']
DEBUG    pytest_multihost.host.Host.master.cmd94:transport.py:519 RUN ['ipa', 'pwpolicy-find', '10newpolicygroup']
DEBUG    pytest_multihost.host.Host.master.cmd94:transport.py:563 bash: line 1: cd: /root/multihost_tests: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd94:transport.py:563 bash: line 2: /root/multihost_tests/env.sh: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd94:transport.py:563   Group: 10newpolicygroup
DEBUG    pytest_multihost.host.Host.master.cmd94:transport.py:563   Priority: 14
DEBUG    pytest_multihost.host.Host.master.cmd94:transport.py:563   Max repeat: 14
DEBUG    pytest_multihost.host.Host.master.cmd94:transport.py:563   Grace login limit: -1
DEBUG    pytest_multihost.host.Host.master.cmd94:transport.py:563 ----------------------------
DEBUG    pytest_multihost.host.Host.master.cmd94:transport.py:563 Number of entries returned 1
DEBUG    pytest_multihost.host.Host.master.cmd94:transport.py:563 ----------------------------
DEBUG    pytest_multihost.host.Host.master.cmd94:transport.py:217 Exit code: 0
INFO     pytest_multihost.host.Host.master.OpenSSHTransport:transport.py:397 RUN ['kdestroy', '-A']
DEBUG    pytest_multihost.host.Host.master.cmd95:transport.py:519 RUN ['kdestroy', '-A']
DEBUG    pytest_multihost.host.Host.master.cmd95:transport.py:563 bash: line 1: cd: /root/multihost_tests: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd95:transport.py:563 bash: line 2: /root/multihost_tests/env.sh: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd95:transport.py:217 Exit code: 0
INFO     pytest_multihost.host.Host.ansible.OpenSSHTransport:transport.py:433 PUT inventory/pwpolicy.hosts
DEBUG    pytest_multihost.host.Host.ansible.cmd51:transport.py:519 RUN ['tee', 'inventory/pwpolicy.hosts']
DEBUG    pytest_multihost.host.Host.ansible.cmd51:transport.py:217 Exit code: 0
INFO     pytest_multihost.host.Host.ansible.OpenSSHTransport:transport.py:433 PUT pwpolicy_module.yml
DEBUG    pytest_multihost.host.Host.ansible.cmd52:transport.py:519 RUN ['tee', 'pwpolicy_module.yml']
DEBUG    pytest_multihost.host.Host.ansible.cmd52:transport.py:217 Exit code: 0
INFO     pytest_multihost.host.Host.ansible.OpenSSHTransport:transport.py:397 RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/pwpolicy.hosts', 'pwpolicy_module.yml']
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:519 RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/pwpolicy.hosts', 'pwpolicy_module.yml']
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 bash: line 1: cd: /root/multihost_tests: No such file or directory
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 bash: line 2: /root/multihost_tests/env.sh: No such file or directory
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 ansible-playbook [core 2.14.2]
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563   config file = /etc/ansible/ansible.cfg
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563   configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563   ansible python module location = /usr/lib/python3.9/site-packages/ansible
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563   ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563   executable location = /usr/bin/ansible-playbook
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563   python version = 3.9.16 (main, Dec  8 2022, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] (/usr/bin/python3.9)
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563   jinja version = 3.1.2
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563   libyaml = True
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 Using /etc/ansible/ansible.cfg as config file
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 Skipping callback 'default', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 Skipping callback 'minimal', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 Skipping callback 'oneline', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 PLAYBOOK: pwpolicy_module.yml **************************************************
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 1 plays in pwpolicy_module.yml
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 PLAY [Playbook to ensure maxrepeat reset.] *************************************
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 TASK [Gathering Facts] *********************************************************
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 task path: /root/pwpolicy_module.yml:2
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 ok: [master.ipadomain.test]
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 TASK [ipapwpolicy] *************************************************************
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 task path: /root/pwpolicy_module.yml:7
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 changed: [master.ipadomain.test] => {"changed": true}
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 PLAY RECAP *********************************************************************
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 master.ipadomain.test      : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:563 
DEBUG    pytest_multihost.host.Host.ansible.cmd53:transport.py:217 Exit code: 0
INFO     pytest_multihost.host.Host.master.OpenSSHTransport:transport.py:397 RUN ['kinit', 'admin']
DEBUG    pytest_multihost.host.Host.master.cmd96:transport.py:519 RUN ['kinit', 'admin']
DEBUG    pytest_multihost.host.Host.master.cmd96:transport.py:563 bash: line 1: cd: /root/multihost_tests: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd96:transport.py:563 bash: line 2: /root/multihost_tests/env.sh: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd96:transport.py:563 Password for admin: 
DEBUG    pytest_multihost.host.Host.master.cmd96:transport.py:217 Exit code: 0
INFO     pytest_multihost.host.Host.master.OpenSSHTransport:transport.py:397 RUN ['ipa', 'pwpolicy-show', '10newpolicygroup']
DEBUG    pytest_multihost.host.Host.master.cmd97:transport.py:519 RUN ['ipa', 'pwpolicy-show', '10newpolicygroup']
DEBUG    pytest_multihost.host.Host.master.cmd97:transport.py:563 bash: line 1: cd: /root/multihost_tests: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd97:transport.py:563 bash: line 2: /root/multihost_tests/env.sh: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd97:transport.py:563   Group: 10newpolicygroup
DEBUG    pytest_multihost.host.Host.master.cmd97:transport.py:563   Priority: 14
DEBUG    pytest_multihost.host.Host.master.cmd97:transport.py:563   Grace login limit: -1
DEBUG    pytest_multihost.host.Host.master.cmd97:transport.py:217 Exit code: 0
INFO     pytest_multihost.host.Host.master.OpenSSHTransport:transport.py:397 RUN ['kdestroy', '-A']
DEBUG    pytest_multihost.host.Host.master.cmd98:transport.py:519 RUN ['kdestroy', '-A']
DEBUG    pytest_multihost.host.Host.master.cmd98:transport.py:563 bash: line 1: cd: /root/multihost_tests: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd98:transport.py:563 bash: line 2: /root/multihost_tests/env.sh: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd98:transport.py:217 Exit code: 0
INFO     pytest_multihost.host.Host.master.OpenSSHTransport:transport.py:397 RUN ['kinit', 'admin']
DEBUG    pytest_multihost.host.Host.master.cmd99:transport.py:519 RUN ['kinit', 'admin']
DEBUG    pytest_multihost.host.Host.master.cmd99:transport.py:563 bash: line 1: cd: /root/multihost_tests: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd99:transport.py:563 bash: line 2: /root/multihost_tests/env.sh: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd99:transport.py:563 Password for admin: 
DEBUG    pytest_multihost.host.Host.master.cmd99:transport.py:217 Exit code: 0
INFO     pytest_multihost.host.Host.master.OpenSSHTransport:transport.py:397 RUN ['ipa', 'pwpolicy-del', '10newpolicygroup']
DEBUG    pytest_multihost.host.Host.master.cmd100:transport.py:519 RUN ['ipa', 'pwpolicy-del', '10newpolicygroup']
DEBUG    pytest_multihost.host.Host.master.cmd100:transport.py:563 bash: line 1: cd: /root/multihost_tests: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd100:transport.py:563 bash: line 2: /root/multihost_tests/env.sh: No such file or directory
DEBUG    pytest_multihost.host.Host.master.cmd100:transport.py:217 Exit code: 0


Based on the test results, marking the bug Verified

Comment 12 errata-xmlrpc 2023-05-09 07:25:56 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-2023:2168


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