Open Stromweld opened 5 years ago
The functionality here in chef-server-ctl for managing orgs/users used to come from knife-opc but that merged into core knife around Infra Client 17 which knife also made a break from being part of the Infra Client.
There was related functionality in knife-acl that made a similar move which gives us knife group list
and knife user list
commands (as well as more dangerous knife acl
commands).
Since the related chef-server-ctl
commands are already just a knife wrapper in https://github.com/chef/chef-server/blob/main/src/chef-server-ctl/plugins/wrap-knife-opc.rb, it would be relatively trivial to add a similar wrapper or refactor that wrapper a little to add chef-server-ctl org-users-list
and chef-server-ctl org-admins-list
.
As well as others for chef-server-ctl of high value like:
mapping is the trickiest part to avoid too terribly of a UX
knife group add user USERNAME admins
could become:
chef-server-ctl org-group-add-user ORG USERNAME admins
or
chef-server-ctl org-group-add ORG user USERNAME admins
Note if we do something like this, as a followup we need to ensure similar coverage in Automate's wrappers around chef-server-ctl in https://github.com/chef/automate/blob/main/components/automate-cs-nginx/cmd/chef-server-ctl/ctl.go.
Describe the Enhancement:
chef-server-ctl commands to list users belonging to specific organization and to list admins of the organization. Commands like:
chef-server-ctl org-users-list
chef-server-ctl org-admins-list
Describe the Need:
Anyone. This would also make fixing the idempotency of the chef-ingredient cookbook org resource user properties idempotent https://github.com/chef-cookbooks/chef-ingredient/blob/master/resources/chef_org.rb#L52
Current Alternative
Not to my knowledge
Can We Help You Implement This?:
Have to find how similar commands work and see if can replicate them at the org level