chef-workstation icon indicating copy to clipboard operation
chef-workstation copied to clipboard

Unable to create admin with knife

Open themaroqa opened this issue 2 years ago • 3 comments

Description

In my company the process for creating a new chef admin has been built using powershell script as follow:

Write-Output "Creating user $Username"
knife user create $Username --email $Mailaddress --password $Password -f $Path_to_pem
Write-Output "Adding to the default organization"
knife org user add default $Username
Write-Output "Adding to the admins group"
knife group add user $Username admins

Unfortunately recently something changed and the text editor for confirming the user creation and the pem file stopped being generated. That means we are not able anymore to provides to new admins their private keys and thus working with knife. We use pivotal credential for running those commands. Is this a bug? Did something changed on a previous version that involves us on changing the way we create new admins? Is there a better way for creating them?

Chef Workstation Version

Chef Workstation version: 21.12.720 Chef Infra Client version: 17.8.25 Chef InSpec version: 4.50.3 Chef CLI version: 5.4.2 Chef Habitat version: 1.6.420 Test Kitchen version: 3.2.2 Cookstyle version: 7.25.10

Platform Version

Windows 10 (10.0.19043)

themaroqa avatar Jan 14 '22 16:01 themaroqa

Able to reproduce this issue using Infra Client version: 17.8.25

This issue is caused because of the following reasons

  • In infra API endpoint, body params create_key is missing

    • while debugging found, Ref user_hash doesn't contain create_key
  • ~~And change in API response. As infra has API versions 0 and 1 used while creating users.~~

sanjain-progress avatar Feb 17 '22 11:02 sanjain-progress

Hey @sanjain-progress do you know in which version the fix will be applied? Just tested using Chef Workstation version: 22.5.923 and the issue is still there

themaroqa avatar Jun 01 '22 09:06 themaroqa

Hey @themaroqa This fix is still not released. Once this is released I will notify you

sanjain-progress avatar Jun 02 '22 20:06 sanjain-progress