So friends, let's walk through the solution.
Now the first thing to state is that NGP is ultimately all about time
synchronization.
And if you recall in the earlier skills, we actually saw that there was
actually a time sync role
directly within the rail system roles.
Now this is something that you really should make great use of.
Rail system roles really can make your life much, much easier.
So because of that, what we're going to do is we're going to ensure that we
have them available to us.
So in this case here, what I will do is I'll start off by saying to the DNF,
install a rail-system-ros-answer. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
install a rail-system-ros-answer.
Now just give this a moment, hit Y and enter the game.
Now as we can see here, we have these available to us.
Now with these now installed, if you happen to go in to the user, share-answer
able-ros-directory,
this is where all these roles should actually exist.
You see that?
Say for example, rail-system-ros-time-sync,
and also if you recall, in our answerable csh file, when we actually configured
a role path,
we specified that answerable would look in our roles directory.
This is our relative path.
So any type of custom roles we placed in this directory would be picked up. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So any type of custom roles we placed in this directory would be picked up.
But also remember, after the colon, we have another path entirely.
Now this is actually the path of where the rail system roles are going to
reside.
So they also will be picked up.
And again, we also have this third path right here.
So because we actually have this path, they should actually be available to us.
One other location I really want to talk to you about is one that we saw
earlier on,
we talked about roles, and this is the user-share.rail-system-ros.
Now this is your best friend.
Okay, so if we go in here, we can see all of these directories, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Okay, so if we go in here, we can see all of these directories,
and inside of these directories, we're going to have both examples,
as well as descriptions about how to use the role itself.
So we want to effectively create some time synchronization.
So if we go into our time-sync directory, and do an LS,
we can actually see we both have an example for a single pool playbook,
as well as a multiple pool, and we also have a readme file.
So it's going to the readme.md file right here.
And as we can see, we actually get this collection about what this role is
going to do.
It's going to allow us to install and configure NTP or PTP implementation. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
It's going to allow us to install and configure NTP or PTP implementation.
So if I scroll on down, we can see all of these role variables,
and it tells us the variables that can be passed into the role itself.
Now check this out, think about what we've got to do.
This key right here, the hostname, is going to allow us to specify the hostname
or the address of the server.
Now in our case, we're asked to configure a server 192.168.100.1.
So we want to feed this particular value into this particular parameter right WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So we want to feed this particular value into this particular parameter right
here.
Similar label also has to specify the minimum polling interval,
which we can see right here.
Now in that case here, we would use the min poll keyword,
and then specify the value.
Now I believe the value we had to use was two,
whereas we also had to specify the maximum polling interval,
which we can see right here.
And that is denoted with the max poll key,
and the value this time for us should be six.
Now also we were supposed to enable fast initial synchronization,
and we can see here we do this by specifying the key i-burst, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
and we can see here we do this by specifying the key i-burst,
and we just give it a billion value in this case here of true.
So we can see here the documentation pretty much tells us
how to actually implement this just by consulting it quickly.
Now even better yet, if we go back, if I go into my example right here,
we can see how to actually use the actual role.
So what I could do is highlight all of this and right click it and save,
but since it's in an actual text file, what I will do is I'll just copy this
example single playbook, and I'll copy it to my home directory.
So if I go back to my home with the CD, here I am, let's close the screen. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So if I go back to my home with the CD, here I am, let's close the screen.
And if I do an LSP now have this example single playbook,
let's just rename this, and let's just call it NTP_config.yml.
So let's go into here, our new file, and all I want to do is I want to make
some
modifications. Now think about it, what we're really asked to do,
we want to target a particular set of hosts, which is the test group,
and now what we want to do to define our values.
So the host name we're going to use is going to be 192.168.100.1,
so let's just populate that value in.
We also want to ensure that fast synchronization is enabled. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
We also want to ensure that fast synchronization is enabled.
The in the example here, I burst is set to true, which is what we need.
So let's just leave that as it is.
Let's just delete the pull value, we don't need that.
And also, we have to set the minimum polling interval to two,
and the maximum polling interval to six.
So we saw the keys we had to use was
"minpool" and "maxpool" as per the documentation.
So let's just say "minpool" is equal to two,
and "maxpool" is equal to six.
And with that now done, we should be ready to go.
So let's just say "answerable playbook, NTP_config.yml" and to answer. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Oh, we're actually going to gather facts, let's just speed things up,
just in order to keep things really quick.
I do like to do that, so let's go back in.
I'm not a fan of gathering facts unless I really need them, so let's just save
this.
And let's try again.
So now it kicks off, the row goes, just give it a moment to actually run
through.
And we can see the playbook completes, we've now made the configuration changes
.
So if I want to verify this, I can say "answerable" against the test group.
And I'll say the command I want to run is going to be "goret".
I'm going to "goret" for the actual IP address that I configured,
192.168.100.1.
And the file I'm going to target is going to be the "8sacrona.conf" file. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And the file I'm going to target is going to be the "8sacrona.conf" file.
If I enter here, look at what we actually get.
We can see here device number one,
which is a member of the test group actually does have this configuration.
It's got the server of 192.168.100.1.
And then pull value of two, and max pull value of six,
and I burst fast synchronization has been enabled.