How can I install packages from the RHEL6's Optional Channel via Kickstart?

I typically install puppet via kickstart. Apparently, puppet now requires a package (libselinux-ruby) that is included in the Red Hat's Optional Channel.

I was under the impression I could only use the Optional Channel by assigning the appropriate Software Channel entitlement after the server was provisioned with RHN.

Does this mean that we cannot use kickstart to install packages that are in the Optional Channel? If that is not the case, how would we configure our kickstart accordingly?


Solution 1:

What I've done is:

  1. In RHN I set up an "activation key" (look for it in "Systems") that is subscribed to the Optional channel. It's possible to do this with one key for all architectures.
  2. made a kickstart that includes all these bits:

    repo --name=epel --baseurl=http://LOCALEPELMIRROR/.../epel/6/x86_64/
    %package
    ...
    epel-release
    
    %post
    ...
    /usr/sbin/rhnreg_ks --activationkey=$ACTIVATIONKEY
    rpm --import /usr/share/rhn/RPM-GPG-KEY
    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release-2
    ...
    yum install puppet