Skip to content

Instantly share code, notes, and snippets.

@jamesbeedy
Last active September 10, 2017 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesbeedy/eaca40c935ffc8c2cfaf0ca7e0f33d4d to your computer and use it in GitHub Desktop.
Save jamesbeedy/eaca40c935ffc8c2cfaf0ca7e0f33d4d to your computer and use it in GitHub Desktop.
list juju model users
#!/bin/bash
set -e
model="`juju models --format json | jq -r '.["current-model"]'`"
users=`juju show-model $model --format json | model=$model jq '.[env.model]["users"]' | jq -r 'keys[] as $k | "\($k)"'`
printf "Users in $model\n\n"
for user in $users; do
echo $user;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment