We now have a working build server. When we use yoda to build systems, we get consistent installations. The configuration of these systems is close to what. We want o minimize post-install customization to save time and improve quality.
Today we will customize our build process to:
Yoda is currently configured to use repositories from a local DVD. All the files from that DVD where copied to yoda's /var/www tree and published via http. In name of consistency, and to avoid "forgot to mound the DVD" errors, we will change yoda's repo files to point to yoda's published repositories.
cd /etc/yum.repos.d mv LocalBase.repo yodaBaseOS.repo
[yodaBaseOS] metadata_expire=-1 name=yodaBaseOS baseurl=http://yoda/83/BaseOS enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
yum clean all yum list | morewe can use the "power of pipelines"© to see just the repo names
yum list | tail -n +8 | awk '//{ print $3;}' | sort -uWhy do some repo names start with @?
yum clean all yum list | tail -n +8 | awk '//{ print $3;}' | sort -u
yoda hosts a patch repo, miniUpdate, but needs a .repo file in order to access it.
yum clean all yum list | tail -n +8 | awk '//{ print $3; }' | sort -u
yum clean all yum list | tail -n +8 | awk '//{ print $3;}' | sort -u
yum update
By default the installer sets up systems to use Red Hat's repositories from the open 'net. We want all of our servers to use only packages and patches we have tested. We will configure every server we build to use yoda for all repositories.
We need to modify our Kickstart file so that the repo files are created on each system. Kickstart does not have a command to do this. We will have to use shell commands in the %post section. We can use echo to create the files, or we can use curl to download them. We will use the curl strategy.
mkdir /var/www/html/yum.repos.d
cp -v /etc/yum.repos.d/*repo /var/www/html/yum.repos.d
cd /tmp curl http://yoda/yum.repos.d/miniPatch.repo
ls miniPatch.repo # should result in No such file or directory curl -O http://yoda/yum.repos.d/miniPatch.repo cat miniPatch.repo
cp -a /var/www/html/Kickstart/default.ks /var/www/html/Kickstart/default.ks.working
cd /etc/yum.repos.d curl -O http://10.1.1.100/yum.repos.d/miniPatch.repo curl -O http://10.1.1.100/yum.repos.d/yodaBaseOS.repo curl -O http://10.1.1.100/yum.repos.d/yodaAppStream.repo
Our repo files refer to yoda by name not IP address. We need an entry for yoda in the hosts file of every server we build.
yum repolist
yum update
I don't trust myself to remember to run yum update to patch the system every time I build. Since we do not deploy unpatched systems, it makes sense to make patching part of the automated build.
We have a couple of choices. We could add yum update -y to the %post section of our Kickstart file. Or we could take advantage of YUM's ability to automatically select the latest available version of any package. This is the strategy we will use.
repo --name="AppStream" --baseurl=http://10.1.1.100/83/AppStream
We have used a custom partitioning scheme for all our servers. We do this to isolate directories trees that are likely to grow. We do this to avoid running out of space on the root file system.