Merge "Support list of Red Hat channels and repos"
This commit is contained in:
commit
f67a3805e2
@ -10,9 +10,11 @@ Certificate-based Red Hat Subscription Managment (RHSM) is the default registrat
|
||||
|
||||
* Set DIB_RHSM_USER and DIB_RHSM_PASSWORD to register the system with RHSM during the image building process. This will apply the associated Red Hat Enterprise Linux Server subscription so the latest package updates can be applied. At the end of the image building process, the system will be unregistered from RHSM.
|
||||
* Set DIB_RHSM_POOL to a subscription pool if you do not want the system to use the `--auto-attach` feature of `subscription-manager`.
|
||||
* Set DIB_RHSM_REPOS to a space-separated list of Red Hat repositories to enable.
|
||||
|
||||
## Red Hat Network (RHN)
|
||||
|
||||
Set `DIB_REG_TYPE=rhn` for Red Hat Network (RHN classic) registration. The image building process will register the system to RHN and apply the associated Red Hat Enterprise Linux Server subscription so the latest package updates can be applied. At the end of the image building process, the system will be unregistered from RHN.
|
||||
|
||||
* For RHN username/password authentication set DIB_RHSM_USER and DIB_RHSM_PASSWORD.
|
||||
* Set DIB_RHN_CHANNELS to a space-separated list of RHN channels to add. Example: `DIB_RHN_CHANNELS=rhel-x86_64-server-6 rhel-x86_64-server-6-rhscl-1`.
|
||||
|
@ -10,6 +10,11 @@ if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ]
|
||||
sleep 1
|
||||
# optional channel required for diskimage-builder dependency
|
||||
channels="-a -c rhel-x86_64-server-optional-6"
|
||||
if [[ -n "$DIB_RHN_CHANNELS" ]]; then
|
||||
for chan in $DIB_RHN_CHANNELS; do
|
||||
channels="$channels -a -c $chan"
|
||||
done
|
||||
fi
|
||||
rhn-channel --user=$DIB_RHSM_USER --password=$DIB_RHSM_PASSWORD $channels
|
||||
rhn-channel -l
|
||||
else
|
||||
@ -23,6 +28,11 @@ if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ]
|
||||
fi
|
||||
# optional repo required for diskimage-builder dependency
|
||||
repos="--enable rhel-6-server-optional-rpms"
|
||||
if [[ -n "$DIB_RHSM_REPOS" ]]; then
|
||||
for repo in $DIB_RHSM_REPOS; do
|
||||
repos="$repos --enable $repo"
|
||||
done
|
||||
fi
|
||||
subscription-manager repos $repos
|
||||
subscription-manager repos --list
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user