I’ve been spending the last few hours trying to register a Red Hat Enterprise Linux machine during kickstart. What I wanted to achieve:
- Kickstart
- Register the machine with certificate based method (subscription-manager)
- Install Puppet which will take care of the remainder of the configuration.
The really short version
This all goes into your anaconda kickstart file. Replace USERNAME and PASSWORD or use activation key (haven’t tested):
# register echo "registering with redhat using certificate method" subscription-manager register --username=USERNAME --password=PASSWORD --autosubscribe # update all the base packages from the updates repository, also important since # yum-config-manager doesn't function until you do something with yum! echo "updating machine" yum -t -y -e 0 update # add optional red hat repository needed for puppet echo "adding optional repository" yum-config-manager --enable rhel-6-server-optional-rpms # install epel if we can echo "configuring epel repository" rpm -Uvh http://download.fedora.redhat.com/pub/epel/beta/6/x86_64/epel-release-6-5.noarch.rpm # install puppet echo "installing puppet" yum -t -y -e 0 install puppet
The LONG version
Why certificate based?
I haven’t confirmed yet, but hoping that the new content delivery framework “cdn.redhat.com” is a lot faster here in Iceland (currently ~200-300KBps).
On with the butter! (Icelandic saying)
The old way used to be:
rhnreg-ks --username <username> --password <password>
New way, autosubscribe tries to enable to correct subscription automatically:
subscription-manager register --username=<username> --password=<password> --autosubscribe
OK Great, now I’m subscribed, on to installing puppet
First we need the epel repository to get puppet
The EPEL repository contains lots of extra package for rhel including puppet.
rpm -Uvh http://download.fedora.redhat.com/pub/epel/beta/6/x86_64/epel-release-6-5.noarch.rpm
On to the tricky stuff
puppet is in the epel repo, check. But it requires libselinux-ruby which is in the rhel-6-server-optional-rpms repository so installing puppet without enabling it will blow up because of dependency problems.
Enabling rhel-6-server-optional-rpms
Old version (pre 6.1) used rhn-channel, we use the new tools. Now here is what cost me quite some time. When you run “subscription-manager register” I think that the /etc/yum.repos.d/redhat.repo is not created. Not untill you run some yum commands, so that’s why I update here but I suspect any (install/update) command will do:
yum -y -e 0 update yum-config-manager --enable rhel-6-server-optional-rpms
Finally, ready to rock and roll!
yum -y -e 0 install puppet
You should have a puppet ready on RHEL 6.1<
Decided to attach a picture of the damage that problems like these do to my hairstyle!
