mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
redfish_utils: adding "Id" to the add user function (#3343)
* Adding "Id" to the add user function Some implementations of Redfish (e.g. the one in Cisco's CIMC) seem to require the id of the new user for account creation. I'm not that firm with Python but lines 982 and 983 should fix it. * changed indention * created changelog fragment * Update changelogs/fragments/3343-redfish_utils-addUser-userId.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update change type * supplemented the description of the ID parameter * Update plugins/modules/remote_management/redfish/redfish_command.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
06345839c6
commit
331f5bdf24
3 changed files with 6 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- redfish_utils module utils - if given, add account ID of user that should be created to HTTP request (https://github.com/ansible-collections/community.general/pull/3343/).
|
|
@ -979,6 +979,8 @@ class RedfishUtils(object):
|
||||||
payload['Password'] = user.get('account_password')
|
payload['Password'] = user.get('account_password')
|
||||||
if user.get('account_roleid'):
|
if user.get('account_roleid'):
|
||||||
payload['RoleId'] = user.get('account_roleid')
|
payload['RoleId'] = user.get('account_roleid')
|
||||||
|
if user.get('account_id'):
|
||||||
|
payload['Id'] = user.get('account_id')
|
||||||
|
|
||||||
response = self.post_request(self.root_uri + self.accounts_uri, payload)
|
response = self.post_request(self.root_uri + self.accounts_uri, payload)
|
||||||
if not response['ret']:
|
if not response['ret']:
|
||||||
|
|
|
@ -56,7 +56,8 @@ options:
|
||||||
required: false
|
required: false
|
||||||
aliases: [ account_id ]
|
aliases: [ account_id ]
|
||||||
description:
|
description:
|
||||||
- ID of account to delete/modify
|
- ID of account to delete/modify.
|
||||||
|
- Can also be used in account creation to work around vendor issues where the ID of the new user is required in the POST request.
|
||||||
type: str
|
type: str
|
||||||
new_username:
|
new_username:
|
||||||
required: false
|
required: false
|
||||||
|
|
Loading…
Reference in a new issue