Skip to content
Snippets Groups Projects
Commit 2e4ae939 authored by Francisco Borges Aurindo Barros's avatar Francisco Borges Aurindo Barros
Browse files

Script to recreate AdminRole

parent 723d36ab
No related branches found
No related tags found
1 merge request!16Modify authz resources
Pipeline #3541590 passed
#!/bin/bash
usage() { echo "Usage: $0 [--project <PROJECT>]" 1>&2; exit 1; }
# Options
ARGS=$(getopt -o 'p:' --long 'project:' -- "$@") || exit 1
eval "set -- $ARGS"
while true; do
case "$1" in
(-p|--projec)
PROJECT="$2"; shift 2;;
(--) shift; break;;
(*) usage;;
esac
done
[[ -z "${KUBECONFIG}" ]] && echo "No cluster access!" && usage
[[ -z "${PROJECT}" ]] && usage
ROLE_NAME="new-administrator"
ADMIN='
{
"apiVersion": "webservices.cern.ch/v1alpha1",
"kind": "BootstrapApplicationRole",
"metadata": {
"name": "'${ROLE_NAME}'",
"namespace": "'${PROJECT}'"
},
"spec": {
"applyToAllUsers": false,
"description": "Role for Administrators of the Drupal website",
"displayName": "Administrator",
"minLevelOfAssurance": 5,
"multifactorRequired": false,
"name": "administrator",
"required": false
}
}
'
createRole=$(echo ${ADMIN} | oc apply -f -)
echo $createRole
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment