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

chef-server-ctl org-users-list <org-name>

Open Stromweld opened this issue 6 years ago • 2 comments

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

Stromweld avatar Jan 09 '19 19:01 Stromweld

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:

  • org-group-list
  • org-group-add-user
  • org-invite ... or user-invite ...
  • the list at knife-acl/lib/chef/knife should be considered, although that could be separate scope.

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

btm avatar Jan 28 '22 17:01 btm

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.

btm avatar Jan 28 '22 17:01 btm