So, in this video, I'm going to show you how to set up the web server to use the Kickstart
file.
Don't worry about this for RHCSA, this won't be on RHCSA, but it's cool knowledge and I'd
love to share this cool knowledge with you.
So, if you are feeling you're ready for a real challenge and you want to bring everything
together, try this, and if you think you've had enough, feel free to skip this information.
So now that we have set this up, how are we going to use it?
Well, RHEL can be installed from a boot C image, and the easiest way to do so is by
using Kickstart.
If you want to install in virtual or in cloud, alternatively, you can convert a boot C image
into a disk image, that's something we are not going to cover here.
While installing, the container runtime is not needed anymore, it's just an installation
image that you are going to write to disk.
So how do we use Kickstart?
Well, Kickstart was introduced to perform automated installations a long time ago.
At the end of the installation, a file with the name anaconda-ks.cfg is created, and you
can use this file as the main input for the automated installation.
The nice thing is that it has a blueprint of all that you have done during the real
installation.
But you do need a couple of modifications.
Normally, there will be a percent package section that needs to be removed, and that
needs to be replaced with OS3 container minus minus URL equals.
Now behind the URL equals, you need to have the container fully qualified container name.
So that is exactly the name as you have pushed the image to your local registry.
In this example, it looks like registry.example.com, colon 5000 slash boot image, because that's
what we have pushed.
Now in Kickstart, you need to consider your users.
By default, a root user and an administrative user are created, and you need to provide
passwords for these users.
There are two options.
You can use the hash of the encrypted password using dash dash is encrypted followed by minus
minus password.
Or use minus minus plain text where password is whatever you want on your Kickstart.
Now if needed, the password crypto string can be generated on a local machine using
passwd, and you can copy it from etcshadow in the Kickstart file.
To make it a little bit easier for you, I'm providing an example Kickstart file, ks.cfg.
It's in the course Git repository.
Just copy it over to your Apache document root and use it so that you don't have to
modify the Kickstart file as well.
So next, you need to use the Kickstart file.
So typically, you copy it to a web server before you can use it.
And when you do that, you need to make sure that it's available in the document root.
And the document root obviously is normally set to var www.html, but you need to make
sure that that is still true for the web server that you are going to use.
Because if you've done the SELinux labs, you might have a different document root.
Verify it.
After copying the Kickstart file to the web server document root, use resrc minus rv on
the document root to ensure that SELinux allows access.
After taking care of SELinux, you need to take care of permissions.
chmod 644 on your Kickstart file will do it.
And then obviously restart Apache so that it picks up all of the configuration changes.
And don't forget to open a port in the firewall as well to allow access to HTTP.
Now you should know that due to lab restrictions, you may have to refer to the web server using
the IP address, not the DNS name.
I'm not assuming that you are setting up a DNS name that resolves all the different names
that you might want to use here.
Now let me show you how to bring all of this together.
Okay, so here we have the normal RHEL boot prompt.
And I need to edit it.
At the end of the line that loads the kernel, I'm adding inst.ks equals HTTP colon slash
slash IP address of my server.
Name resolving doesn't work because I'm on a completely different machine that doesn't
know anything about the ETC host modifications that I've done.
And ks.cfg, that's the Kickstart file that I am going to use.
And then control X, and that should pick it up.
So if you can read fast, then you could have seen that Kickstart is picking up the installation
right now.
And the installation is being started.
And there you go.
This is the image mode installation.
And the result, well, we need to wait for a few minutes, and then it will be done.