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 2168022 - ansible-freeipa ipauser add support GECOS field
Summary: ansible-freeipa ipauser add support GECOS field
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: ansible-freeipa
Version: 8.7
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Rafael Jeffman
QA Contact: Varun Mylaraiah
URL:
Whiteboard:
Depends On:
Blocks: 2169372
TreeView+ depends on / blocked
 
Reported: 2023-02-08 03:27 UTC by Sunny Wu
Modified: 2023-11-14 16:15 UTC (History)
4 users (show)

Fixed In Version: ansible-freeipa-1.11.1-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2169372 (view as bug list)
Environment:
Last Closed: 2023-11-14 15:26:23 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-9416 0 None None None 2023-02-08 03:28:45 UTC
Red Hat Issue Tracker RHELPLAN-147883 0 None None None 2023-02-08 03:28:48 UTC
Red Hat Product Errata RHBA-2023:6926 0 None None None 2023-11-14 15:26:56 UTC

Description Sunny Wu 2023-02-08 03:27:39 UTC
Description of problem:

ipauser module is not able to add gecos field:

~~~
- name: Playbook to handle users
  hosts: ipaserver
  become: true

  tasks:
  - ipauser:
      ipaadmin_password: '{{ ipaadmin_password }}'
      name: user1
      first: UserFirst
      last: UserLast
      phone: "+1234567890"
      email: user1
      password: "mypassword"
      gecos: UserFirst            <<<<<=====
      update_password: on_create
~~~
~~~
fatal: [<...>]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (ipauser) module: gecos. Supported parameters include: phone (telephonenumber), nomembers, preserve, radius (ipatokenradiusconfiglink), userclass (class), mobile, manager, preferredlanguage, shell (loginshell), update_password, principalexpiration (krbprincipalexpiration), userauthtype (ipauserauthtype), title, userstate (st), noprivate, state, users, ipaadmin_password, name (login), passwordexpiration (krbpasswordexpiration), certificate (usercertificate), certmapdata, displayname, password, employeenumber, random, carlicense, ipaadmin_principal, radiususer (ipatokenradiususername, radiususername), last (sn), ipaapi_context, city, gid (gidnumber), homedir, email, departmentnumber, pager, uid (uidnumber), initials, employeetype, fax (facsimiletelephonenumber), sshpubkey (ipasshpubkey), first (givenname), action, principal (krbprincipalname, principalname), postalcode (zip), ipaapi_ldap_cache, orgunit (ou), fullname (cn)."}
~~~

The field is not in source code in v1.9.2 

https://github.com/freeipa/ansible-freeipa/blob/v1.9.2/plugins/modules/ipauser.py

-----

This field is supported in command line:

~~~
$ ipa user-add -h
Usage: ipa [global-options] user-add LOGIN [options]

Add a new user.
Options:
  -h, --help            show this help message and exit
  --first=STR           First name
  --last=STR            Last name
  --cn=STR              Full name
  --displayname=STR     Display name
  --initials=STR        Initials
  --homedir=STR         Home directory
  --gecos=STR           GECOS        <<<<<=====
  --shell=STR           Login shell
~~~

Comment 2 Rafael Jeffman 2023-02-13 17:53:40 UTC
Upstream PR: https://github.com/freeipa/ansible-freeipa/pull/1039

Comment 8 Varun Mylaraiah 2023-08-02 08:58:53 UTC
Verified

ansible-core-2.15.1-1.el8.x86_64
ansible-freeipa-1.11.1-1.el8.noarch

PASSED ansible_freeipa_tests/user/test_user.py::TestUserModule::test_user_add_with_gecos
PASSED ansible_freeipa_tests/user/test_user.py::TestUserModule::test_user_update_gecos_field
PASSED ansible_freeipa_tests/user/test_user.py::TestUserModule::test_user_reset_gecos_field
PASSED ansible_freeipa_tests/user/test_user.py::TestUserModule::test_user_add_gecos_with_unicode_char


Based on the above test result, marking the bug Verified

Comment 11 errata-xmlrpc 2023-11-14 15:26:23 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-2023:6926


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