So I hope you have fully recovered from that previous video.
I know that was a lot to actually get to,
but with that now done,
we're in a good place to begin practicing some of our skills.
So in this particular video,
we're going to focus in on the actual configuration of our managed nodes.
Okay, this is the important part.
So let's pretend we're in an examination,
and what I'm going to ask you is to configure your managed nodes
to actually access the base OS and AppStream packages
from the repository that we just configured. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
from the repository that we just configured.
So right now, what I would encourage you to do is
to pause the video momentarily,
and then I'll walk through how I would actually solve this particular problem.
Okay, so I've unposed the video, I'm now back.
Let me see how you actually did by comparing it to how I solved this particular
problem.
So first thing to actually consider is we want to think,
"Hmm, how are we actually going to configure a repository server?"
Now recall, within this particular course,
we discussed something known as the YUM_Repository module.
Now this one should maybe stand out in your mind WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now this one should maybe stand out in your mind
because it was a little bit strange because as we know in modern rail-based
systems,
we actually don't really use YUM anymore.
In fact, it's basically been replaced by DNF,
although both are effectively compatible with one another.
So despite the fact that DNF is the more modern solution,
the Ansible module to configure a repository is still known as YUM_Repository.
So this is the one that we're going to look at.
So let's go and write this playbook.
So let's just call this one, oh I don't know,
"configure_remote_repose.YML" okay. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
"configure_remote_repose.YML" okay.
Now in this particular case, what I want you to do is to target all of the
devices,
so that is the two devices.
So at the very top, I have my three hyphens,
I'll give this playbook a name,
I'm just taking "figure_repose" on all devices.
Now I'll target the host, who am I going to target,
I'll target the all group.
Do I want to gather facts?
Well, I don't actually have to use them,
so what's the point? It's just going to slow me down.
Let's just save the seconds and we'll configure that to be false.
Although I will say if you do actually gather facts,
that's perfectly fine, you're not going to lose any points for that at all. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
that's perfectly fine, you're not going to lose any points for that at all.
Okay, so let's define our tasks.
And the first task is going to be "configure_appstream".
Cool, so what I'm going to use, I'm going to use the Ansible built-in YUM_Rep
ository module.
Now again, just to refresh your mind with respect to the YUM_Repository module,
we want to specify the base URL,
which is going to be the URL to the directory,
where are the YUM repositories repo data directory actually lives?
This can be a list of multiple URLs.
We also have our description right here, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
We also have our description right here,
which is going to be a human readable string describing the repository.
"Enabled", we can specify as a billion value,
this is the default, it's going to be true.
It specifies whether or not YUM should actually use this repository.
Now the GPG check, this is important.
If we happen to specify that the value is false,
then we're not going to effectively perform our GPG signature check.
However, if we actually do,
then we want to supply the GPG key value
and then specify the URL pointing to the actual GPG key file. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
and then specify the URL pointing to the actual GPG key file.
So say for example, you may in fact be asked to specify a GPG check,
set as to true, and then we also want to add in that actual GPG key.
Now we have the name key, which is specified as required,
if the state is set to present or absent.
And in here, we provide a unique repository ID.
So let's take this information and build the playbook.
So let's use the name parameter right here,
or specify it's going to be AppStream,
we're going to configure right here.
Then we'll have a description,
or just say AppStream on the control node. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
or just say AppStream on the control node.
Now what is the base URL?
This is always very, very important.
Now of course, on my Loho system right here,
my IP address is 192.168.160.133.
So I want to say that my devices should reach this
via HTTP, and then I'll say colon forward slash forward slash
and type in the IP address.
Obviously modify this to whatever your environment happens to be,
or whatever you're asked to actually use as the base URL.
Maybe you'll actually have a domain name,
maybe you'll have an IP address, who knows.
And then I'll say forward slash repo,
and then I want to actually target AppStream particularly, okay. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
and then I want to actually target AppStream particularly, okay.
Then I'll say enabled is equal to true,
and then I'll set GPG check to the value of false.
So this is going to be how I configure AppStream,
and I'll do the same type of thing with respect to base OS,
so I'll just give this a new name,
or just I configure base OS.
Once again, what am I going to use?
The exact same module,
Ansible built in, YumRepository.
The name this time is going to be base OS.
The description will just be base OS on the control node.
And then I'll specify the base URL.
Once again, really, really similar, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Once again, really, really similar,
we're going to target the same server over HTTP.
But once again, target that repo directory,
this time though, we're going to access base OS.
And again, we'll have enabled set to true
and GPG check set to false.
So let's check this out and see how we actually get on.
So all we'll do here is I'll say Ansible,
hyphen playbook configure remote repos and hit enter.
Oh, I'm going to have a spelling mistake right there.
Let's go back in.
Notice I wrote rest positoro.
This is obviously an error. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
This is obviously an error.
It should be a repository.
Let's just save this, apologies about that.
I'll do it and try again.
Now the playbook kicks off and we have our changes.
So let's go to our devices.
So over on device number one,
if I say pseudo DNF repo list and to enter,
type in my password of password one,
notice we can actually see here we have configured
AppStream and base OS over on the control node.
Now here's the test.
If I happen to say pseudo DNF updates and to enter,
notice we don't get any errors.
It just says there is nothing to do.
So what I will try to do is I'll now say pseudo DNF install. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So what I will try to do is I'll now say pseudo DNF install.
And let's try to install say, for example,
engine X directly from the control node.
If I enter now, look at what we actually have here.
We have the option to actually begin installing
this particular package over my control node.
So say, for example,
if I just say a Y for yes, it's going to begin installing
and now I actually have engine X on my system.
So if I say systemctl status for engine X,
notice we actually do have the service module.
It just happens to be disabled and inactive.
But of course, if I so watched what I could do,
is I could say, so the systemctl and I could start engine X. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
is I could say, so the systemctl and I could start engine X.
And then if I check the status,
now we can see engine X is active
and running on the system.
All of this enabled because we were able to download
the actual package without having to register
over the internet for your subscription manager to Retat.
We simply used the repo server to server up the actual
packages via what we copied over from our optical disk.
So as we can see here with the Yum repository module,
very, very important, we can actually configure our servers
to actually use a specific server to act as a repository host. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
to actually use a specific server to act as a repository host.