WEBVTT

1
00:00.000 --> 00:04.410
So friends in the previous video we just ran our playbook which was going to

2
00:04.410 --> 00:04.960
effectively

3
00:04.960 --> 00:09.200
make some configuration changes to our networking on both of our target devices

4
00:09.200 --> 00:10.240
. Now when we ran

5
00:10.240 --> 00:14.720
our verification check it didn't quite seem like the actual configurations had

6
00:14.720 --> 00:15.760
actually changed.

7
00:15.760 --> 00:19.590
Now let me just quickly verify that the configurations were indeed pushed to

8
00:19.590 --> 00:20.560
the devices and we can do

9
00:20.560 --> 00:24.610
that by going to one of the devices right here. Again whilst the IP adder does

10
00:24.610 --> 00:25.520
not actually show

11
00:25.520 --> 00:31.670
any IP address configuration change if I happen to say nmcli con show we can
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

11
00:25.520 --> 00:31.670
any IP address configuration change if I happen to say nmcli con show we can

12
00:31.670 --> 00:32.400
see both of the

13
00:32.400 --> 00:38.120
connections let me target the ens 160 right here. Now if I just space bar down

14
00:38.120 --> 00:39.520
and we go to this

15
00:39.520 --> 00:43.790
option right here ipv4 addresses we can see right here look at the

16
00:43.790 --> 00:45.840
corresponding address this is

17
00:45.840 --> 00:49.730
actually the IP address that we pushed out to the device similar left we slide

18
00:49.730 --> 00:50.560
on over to the

19
00:50.560 --> 00:57.610
blue box and I just say nmcli con show and do ens 160 and to enter hit spacebar

20
00:57.610 --> 00:58.640
similarly down here

21
00:58.640 --> 01:03.400
the configuration is also present so the big reveal is that quite simply we
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

21
00:58.640 --> 01:03.400
the configuration is also present so the big reveal is that quite simply we

22
01:03.400 --> 01:04.560
have to activate

23
01:04.560 --> 01:12.060
the connection so what I can also do now is if I just say nmcli con up and then

24
01:12.060 --> 01:13.840
say ens 160 that's

25
01:13.840 --> 01:17.800
effective going to refresh the configs now when I do this we can see it has

26
01:17.800 --> 01:18.960
been successfully

27
01:18.960 --> 01:23.370
activated and if I now run an IP adder I'll look at this right here the actual

28
01:23.370 --> 01:24.640
configurations have

29
01:24.640 --> 01:29.720
now been applied now of course if we happen to be managing many many devices it

30
01:29.720 --> 01:30.320
doesn't really
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

30
01:29.720 --> 01:30.320
doesn't really

31
01:30.320 --> 01:34.400
make much sense if we happen to be running an automation system to be logging

32
01:34.400 --> 01:35.440
into each device

33
01:35.440 --> 01:40.090
one by one by one and manually typing in that command as such what we could do

34
01:40.090 --> 01:41.280
is simply modify

35
01:41.280 --> 01:45.010
or playbook to perform that task so let's maybe go in and let's change the IP

36
01:45.010 --> 01:45.840
address to let's

37
01:45.840 --> 01:54.160
maybe say I don't know let's go with 192 168 55.1 slash 24 okay now at this

38
01:54.160 --> 01:55.520
point right here we have

39
01:55.520 --> 02:00.000
a role and like I say that's going to push out that particular change once that
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

40
02:00.000 --> 02:00.880
is done we want

41
02:00.880 --> 02:04.680
to run a particular task now what is that task actually going to be well we'll

42
02:04.680 --> 02:05.440
give it a name

43
02:05.440 --> 02:09.840
and we'll just say reload the connection now what are we going to use here well

44
02:09.840 --> 02:11.120
if I just want to

45
02:11.120 --> 02:16.080
run a command I can say Ansible built-in command and then I can specify the

46
02:16.080 --> 02:16.800
command that I want

47
02:16.800 --> 02:22.410
to run which in my case right here is going to be in NMCLI corn up ENS and that

48
02:22.410 --> 02:23.760
should be optimal

49
02:23.760 --> 02:29.920
IP apologizing with that ENS 160 and if I just save this watch what happens now

50
02:29.920 --> 02:30.480
let's clear the
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

50
02:29.920 --> 02:30.480
let's clear the

51
02:30.480 --> 02:35.520
screen and obviously Ansible Playbook Play 2.YML answer insert give it a moment

52
02:35.520 --> 02:36.080
it's going to run

53
02:36.080 --> 02:40.570
through the configurations we make the changes to the particular device now

54
02:40.570 --> 02:41.520
what is actually

55
02:41.520 --> 02:46.570
happening right here it's saying reload the connection so quite simply what is

56
02:46.570 --> 02:47.520
happening is

57
02:47.520 --> 02:51.700
that the connection is now hanging now what does this actually mean well it

58
02:51.700 --> 02:53.280
means that the change

59
02:53.280 --> 02:58.400
was indeed successful now think of the implication of the change that we happen

60
02:58.400 --> 02:59.360
to just meet there

61
02:59.360 --> 03:03.180
so right now what we'll do is press ctrl C to interrupt the execution and like
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

61
02:59.360 --> 03:03.180
so right now what we'll do is press ctrl C to interrupt the execution and like

62
03:03.180 --> 03:04.160
I say if I go to my

63
03:04.160 --> 03:08.640
devices if I clear the screen I just say IP adder look at this right here we

64
03:08.640 --> 03:09.840
actually have the IP

65
03:09.840 --> 03:13.740
address now configured on the device it was directly applied straight away now

66
03:13.740 --> 03:14.720
think about it if we

67
03:14.720 --> 03:18.450
consult our inventory we have blue box and yellow box now what are they

68
03:18.450 --> 03:19.840
actually resolving to in

69
03:19.840 --> 03:23.510
terms of IP addressing well within our it's a host file we can see we have

70
03:23.510 --> 03:24.720
statically mapped the

71
03:24.720 --> 03:29.280
blue box to be this particular IP address and the yellow box to be this

72
03:29.280 --> 03:31.120
particular IP address now
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

72
03:29.280 --> 03:31.120
particular IP address now

73
03:31.120 --> 03:35.540
what we did by virtue of pushing out those changes and automatically activating

74
03:35.540 --> 03:36.320
them immediately

75
03:36.320 --> 03:41.340
we changed this IP address and as soon as that changed the connection between

76
03:41.340 --> 03:41.840
answer ball the

77
03:41.840 --> 03:47.100
control nodes with the blue box device and the yellow box device well those

78
03:47.100 --> 03:48.240
connections are going

79
03:48.240 --> 03:53.060
to be severed and terminated because the connection has been established over

80
03:53.060 --> 03:54.320
this particular IP address

81
03:54.320 --> 03:58.410
for the yellow box and this particular IP address for the blue box and now

82
03:58.410 --> 03:59.760
those IP addresses have

83
03:59.760 --> 04:03.710
been changed on both of those devices so the connection just effectively is
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

83
03:59.760 --> 04:03.710
been changed on both of those devices so the connection just effectively is

84
04:03.710 --> 04:04.480
stripped this is

85
04:04.480 --> 04:07.710
really more of a real world problem as opposed to a labbing issue because it's

86
04:07.710 --> 04:08.560
very very easy to

87
04:08.560 --> 04:11.820
fix in a lab but of course we learn these skills to be able to perform in the

88
04:11.820 --> 04:12.640
real world so it is

89
04:12.640 --> 04:16.560
important to understand that when we do make interface modifications particular

90
04:16.560 --> 04:17.360
via automation

91
04:17.360 --> 04:22.380
systems understand that if we happen to change the IP address and activate that

92
04:22.380 --> 04:23.440
change immediately

93
04:23.440 --> 04:27.330
whilst the automating system is running then we can potentially lock ourselves

94
04:27.330 --> 04:28.320
out of the device

95
04:28.320 --> 04:32.720
because right now if you try to ping the blue box we have no connection and
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

95
04:28.320 --> 04:32.720
because right now if you try to ping the blue box we have no connection and

96
04:32.720 --> 04:34.400
similarly if i try to

97
04:34.400 --> 04:39.690
ping the yellow box also no connection so we can't even log in remotely so just

98
04:39.690 --> 04:40.240
be aware of the

99
04:40.240 --> 04:45.040
consequences of potentially wiping those primary addresses on those interfaces

100
04:45.040 --> 04:46.240
what is often the

101
04:46.240 --> 04:51.280
case is in the world of automation we may actually have a dedicated interface

102
04:51.280 --> 04:52.560
on each of the devices

103
04:52.560 --> 04:56.760
simply used to manage the device quite simply this would be known as an out-of-

104
04:56.760 --> 04:58.160
band management system

105
04:58.160 --> 05:02.240
so effectively these particular interfaces would be dedicated just for
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

105
04:58.160 --> 05:02.240
so effectively these particular interfaces would be dedicated just for

106
05:02.240 --> 05:03.600
connectivity between the

107
05:03.600 --> 05:07.300
automation system and the device to be managed you wouldn't want to be changing

108
05:07.300 --> 05:08.160
those IP addresses

109
05:08.160 --> 05:12.240
they would just be there for that particular purpose so if i run my nnclicon

110
05:12.240 --> 05:13.200
show command and

111
05:13.200 --> 05:17.120
i great for ipv4 addresses we can see the actual address which is configured

112
05:17.120 --> 05:17.840
here so what i will

113
05:17.840 --> 05:24.480
do here is i will say nnclicon mod ens 1/60 ipv4.method auto that should

114
05:24.480 --> 05:27.120
configure the device to run

115
05:27.120 --> 05:32.370
DHCP which will get a dynamic address from the server and i now say nnmsli con
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

115
05:27.120 --> 05:32.370
DHCP which will get a dynamic address from the server and i now say nnmsli con

116
05:32.370 --> 05:34.400
down ens 1/60

117
05:34.400 --> 05:38.480
and bring it back up again we should now actually be able to get the ip address

118
05:38.480 --> 05:39.200
automatically and

119
05:39.200 --> 05:42.440
look at this right here we're back to the original address similarly let's do

120
05:42.440 --> 05:43.440
the same thing on the

121
05:43.440 --> 05:51.010
other device we do nnmsli con mods ens 1/60 ipv4.methods open that should be at

122
05:51.010 --> 05:53.440
1/60 not 1/50 apologies about

123
05:53.440 --> 05:57.510
the mistype then we'll bring the interface down and bounce it back up if i now

124
05:57.510 --> 05:58.640
do an ip adder

125
05:58.640 --> 06:03.200
ingrate for 1.92 as we can see we have the ip address back once again so that
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

125
05:58.640 --> 06:03.200
ingrate for 1.92 as we can see we have the ip address back once again so that

126
06:03.200 --> 06:03.840
is how we can

127
06:03.840 --> 06:07.600
make sure that the interface configurations actually do apply just be aware of

128
06:07.600 --> 06:08.640
that little trap if

129
06:08.640 --> 06:13.230
we do make interface modifications just be aware if that is the primary way you

130
06:13.230 --> 06:14.560
're interacting with

131
06:14.560 --> 06:18.810
your device via automation you do run the risk of locking yourself out just a

132
06:18.810 --> 06:19.840
little real world

133
06:19.840 --> 06:21.280
tip for you to take home.
