Skip to content

Commit

Permalink
Merge pull request #298 from burigolucas/minor-fixes
Browse files Browse the repository at this point in the history
⚡️ Enable non-interactive creation of group/users ⚡️
  • Loading branch information
ckavili authored Sep 13, 2024
2 parents f38b4d1 + 2290b52 commit af8d99c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions docs/99-the-rise-of-the-cluster/1-tooling-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,24 @@ After the installation, you can use this trick to create users and group:

IPA_NAMESPACE="${1:-ipa}"

# 1. On your host - get the admin passwd and connect to IPA
# 1. On your host, get the IPA admin password and set the students password.
oc project ${IPA_NAMESPACE}
export IPA_ADMIN_PASSWD=$(oc get secret ipa-password --template='{{ range .data }}{{.}}{{end}}' -n ipa | base64 -D)
echo ${IPA_ADMIN_PASSWD}
oc rsh `oc get po -l app=ipa -o name -n ${IPA_NAMESPACE}`
IPA_ADMIN_PASSWD=$(oc get secret ipa-password --template='{{ range .data }}{{.}}{{end}}' -n ipa | base64 -d)
STUDENT_PASSWORD='thisisthepassword'

# 2. on the container running IPA Server, create `student` group and add users to it.
# 2. On the container running IPA Server, create `student` group and add users to it.
oc rsh `oc get po -l app=ipa -o name -n ${IPA_NAMESPACE}` bash << EOF
echo ${IPA_ADMIN_PASSWD} | kinit admin
export GROUP_NAME=student
ipa group-add ${GROUP_NAME} --desc "TL500 Student Group" || true
ipa group-add \${GROUP_NAME} --desc "TL500 Student Group" || true
# in a loop add random users to the group
for i in {1..24};do
export LAB_NUMBER="lab$i"
echo 'thisisthepassword' | ipa user-add ${LAB_NUMBER} --first=${LAB_NUMBER} --last=${LAB_NUMBER} --email=${LAB_NUMBER}@redhatlabs.dev --password
ipa group-add-member ${GROUP_NAME} --users=$LAB_NUMBER
printf "\n\n User ${LAB_NUMBER} is created"
export LAB_NUMBER="lab\$i"
echo 'thisisthepassword' | ipa user-add \${LAB_NUMBER} --first=\${LAB_NUMBER} --last=\${LAB_NUMBER} --email=\${LAB_NUMBER}@redhatlabs.dev --password
ipa group-add-member \${GROUP_NAME} --users=\$LAB_NUMBER
printf "\n\n User \${LAB_NUMBER} is created"
done
EOF
```
## Enablement Framework Installation
Now let's go and install the tooling!!
Expand Down

0 comments on commit af8d99c

Please sign in to comment.