Simple Content Access for CentOS repos

Yes I registered using the register host page and ran the bash script on the content host.

Because I like the simplicity of just doing the copy paste from the host registration page

I ended up putting this in the Linux host_init_config default, it fixes the “Unknown Subscription” but it definitely feels hacky.

echo "Resetting Activation Key"
organizationid=$(subscription-manager identity | grep "^org ID:")
organizationid="${organizationid#org ID: }"
organizationid=$(echo "$organizationid" | awk '{ sub(/^[ \t]+/, ""); print }')

activationkey=$(subscription-manager list --consumed | grep "^Subscription Name:")
activationkey="${activationkey#Subscription Name:}"
activationkey=$(echo "$activationkey" | awk '{ sub(/^[ \t]+/, ""); print }')

subscription-manager register --force --org="$organizationid" --activationkey="$activationkey"
3 Likes