Skip to content

Commit

Permalink
Enforce users to use insights
Browse files Browse the repository at this point in the history
Signed-off-by: Javi Polo <[email protected]>
  • Loading branch information
javipolo committed Aug 7, 2024
1 parent b2c21f8 commit d11890a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions training/ilab-wrapper/ilab
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@ IMAGE_NAME="__REPLACE_IMAGE_NAME__"
ENTRYPOINT="ilab"
PARAMS=("$@")

check_insights(){
if [ -f /etc/ilab-skip-insights ]; then
return
fi
if [ -f /etc/insights-client/machine-id ]; then
return
fi
cat << EOF
Error: Host Not Registered with Red Hat Insights
It appears that this host has not been registered with the Insights client
Please refer to the documentation for instructions on how to complete the registration process
For more information, visit
https://gitlab.cee.redhat.com/red-hat-enterprise-linux-ai-documentation/rhelai_v1.1/-/blob/main/building_environment/setting_up_accounts.adoc
EOF
exit 1
}

check_insights

if [[ -n "$ILAB_HOME" ]]; then
HOME="$ILAB_HOME"
fi
Expand Down
21 changes: 21 additions & 0 deletions training/nvidia-bootc/duplicated/ilab-wrapper/ilab
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@ IMAGE_NAME="__REPLACE_IMAGE_NAME__"
ENTRYPOINT="ilab"
PARAMS=("$@")

check_insights(){
if [ -f /etc/ilab-skip-insights ]; then
return
fi
if [ -f /etc/insights-client/machine-id ]; then
return
fi
cat << EOF
Error: Host Not Registered with Red Hat Insights
It appears that this host has not been registered with the Insights client
Please refer to the documentation for instructions on how to complete the registration process
For more information, visit
https://gitlab.cee.redhat.com/red-hat-enterprise-linux-ai-documentation/rhelai_v1.1/-/blob/main/building_environment/setting_up_accounts.adoc
EOF
exit 1
}

check_insights

if [[ -n "$ILAB_HOME" ]]; then
HOME="$ILAB_HOME"
fi
Expand Down

0 comments on commit d11890a

Please sign in to comment.