WEBVTT

1
00:00.000 --> 00:04.550
So friends, the best way I thought to begin this skill would be to begin first

2
00:04.550 --> 00:04.800
talking

3
00:04.800 --> 00:08.480
about the concept of networking within Linux.

4
00:08.480 --> 00:12.660
Quite simply when you happen to be making networking changes via Linux, you can

5
00:12.660 --> 00:13.240
actually

6
00:13.240 --> 00:16.880
implement these changes in a number of different ways.

7
00:16.880 --> 00:21.010
So if we can effectively configure networking in all these different ways on

8
00:21.010 --> 00:21.720
Linux, how

9
00:21.720 --> 00:24.920
should we actually manage this utilising Ansible?

10
00:24.920 --> 00:30.050
Now you may recall on Linux we have this utility known as NetWork Manager, this
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

10
00:24.920 --> 00:30.050
Now you may recall on Linux we have this utility known as NetWork Manager, this

11
00:30.050 --> 00:30.600
is basically

12
00:30.600 --> 00:35.050
used to simplify the configuration of all the networking settings on your

13
00:35.050 --> 00:35.760
device.

14
00:35.760 --> 00:40.240
Now the way in which you can actually interact with network manager actually

15
00:40.240 --> 00:40.960
varies.

16
00:40.960 --> 00:44.430
Quite simply there are three different ways that we can interact with this

17
00:44.430 --> 00:45.080
utility.

18
00:45.080 --> 00:51.120
So the first way in which we can interact with NetWork Manager is using NMTUI.

19
00:51.120 --> 00:54.560
This is the NetWork Manager text user interface.

20
00:54.560 --> 00:58.480
So much this is going to give you this nice little text based interactive menu

21
00:58.480 --> 00:58.840
that is

22
00:58.840 --> 01:01.680
going to allow you to interact with the utility directly.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

22
00:58.840 --> 01:01.680
going to allow you to interact with the utility directly.

23
01:01.680 --> 01:06.420
Next we can also interact with NetWork Manager directly via the NOM graphical

24
01:06.420 --> 01:07.560
user interface.

25
01:07.560 --> 01:11.000
So that we just be using the graphical user interface as we can see right here.

26
01:11.000 --> 01:14.630
So we go to Wire Connections, Wire Settings, click on the options and we can

27
01:14.630 --> 01:15.480
see everything

28
01:15.480 --> 01:16.680
we have right here.

29
01:16.680 --> 01:21.820
Now as you may suspect, these first two options, the text user interface or the

30
01:21.820 --> 01:22.800
graphical user

31
01:22.800 --> 01:26.910
interface, well this is not the way we're going to interact with our device if

32
01:26.910 --> 01:27.440
we happen

33
01:27.440 --> 01:29.280
to be utilizing Ansible.

34
01:29.280 --> 01:34.640
However, the third way in which we can interact with NetWork Manager is via NMC
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

34
01:29.280 --> 01:34.640
However, the third way in which we can interact with NetWork Manager is via NMC

35
01:34.640 --> 01:35.160
LI.

36
01:35.160 --> 01:38.160
Very, very similar to NMTUI.

37
01:38.160 --> 01:42.080
This time though we interact via the command line interface.

38
01:42.080 --> 01:45.930
So say for example I wanted to see my connections, I could say NMCLI,

39
01:45.930 --> 01:47.480
connection show and BAM

40
01:47.480 --> 01:51.240
as we can see as per the output we have two different connections.

41
01:51.240 --> 01:55.910
One for my ethernet interface here with the corresponding universal unique

42
01:55.910 --> 01:56.680
identifier

43
01:56.680 --> 02:01.660
as well as we have our software look back interface primarily used for testing
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

43
01:56.680 --> 02:01.660
as well as we have our software look back interface primarily used for testing

44
02:01.660 --> 02:02.680
connections.

45
02:02.680 --> 02:07.580
All of these types of commands can effectively be invoked utilizing the Ansible

46
02:07.580 --> 02:08.560
command module

47
02:08.560 --> 02:09.800
which was seen before.

48
02:09.800 --> 02:12.760
That is one particular way we can interact with our device.

49
02:12.760 --> 02:16.420
Now if you recall from a previous scale, one thing we have to understand is

50
02:16.420 --> 02:16.960
that when

51
02:16.960 --> 02:23.350
we utilize this particular module, the playbook is not going to be idempotent

52
02:23.350 --> 02:24.520
by nature.

53
02:24.520 --> 02:28.300
Remember this very important term, if we happen to push a command utilizing

54
02:28.300 --> 02:29.040
this particular

55
02:29.040 --> 02:33.720
module and the command doesn't actually make a change on the device pretty much
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

55
02:29.040 --> 02:33.720
module and the command doesn't actually make a change on the device pretty much

56
02:33.720 --> 02:34.160
we push

57
02:34.160 --> 02:37.940
the same configuration over and over and over again Ansible is not going to

58
02:37.940 --> 02:39.480
have the intelligence

59
02:39.480 --> 02:43.120
to know that the configuration already exists and it's going to seek to impose

60
02:43.120 --> 02:44.160
that configuration

61
02:44.160 --> 02:46.920
change over and over and over again redundantly.

62
02:46.920 --> 02:49.800
So of course this isn't really ideal to be honest with you.

63
02:49.800 --> 02:54.680
Now as we're going to learn we can actually utilize NMCLI in a much nicer way.

64
02:54.680 --> 02:58.520
As opposed to just pushing these commands directly what we can do is we can

65
02:58.520 --> 02:59.320
just utilize

66
02:59.320 --> 03:03.920
the NMCLI module that is dedicated for that particular task.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

66
02:59.320 --> 03:03.920
the NMCLI module that is dedicated for that particular task.

67
03:03.920 --> 03:08.640
So really what we're talking about here is managing network via network manager

68
03:08.640 --> 03:08.720
and

69
03:08.720 --> 03:13.660
whilst there are three traditional methods to interact with the utility NNTUI

70
03:13.660 --> 03:14.040
as well

71
03:14.040 --> 03:18.100
as the actual graphical user interface, the only way we are interested in is to

72
03:18.100 --> 03:18.720
interact

73
03:18.720 --> 03:21.200
with network manager via NMCLI.

74
03:21.200 --> 03:25.960
Now like I say this is just if we want to interact with network manager.

75
03:25.960 --> 03:30.660
What we can also do though is we can make these modifications to our networking
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

75
03:25.960 --> 03:30.660
What we can also do though is we can make these modifications to our networking

76
03:30.660 --> 03:31.000
without

77
03:31.000 --> 03:32.720
the use of network manager.

78
03:32.720 --> 03:35.980
Now if you want to use Ansible to do this particular task there are two

79
03:35.980 --> 03:36.880
different ways

80
03:36.880 --> 03:38.120
we can do such a thing.

81
03:38.120 --> 03:42.120
The first way is to actually modify the interface configuration files

82
03:42.120 --> 03:43.080
themselves.

83
03:43.080 --> 03:46.420
Now when you happen to make these changes these changes are going to be

84
03:46.420 --> 03:47.400
persistent.

85
03:47.400 --> 03:50.700
Meaning that if you happen to reboot the system the changes that you define

86
03:50.700 --> 03:51.120
within

87
03:51.120 --> 03:53.600
these configuration files are still going to remain.

88
03:53.600 --> 03:57.030
Now the other way in which we can modify networking configurations without

89
03:57.030 --> 03:57.640
using network

90
03:57.640 --> 04:01.520
manager is also via the IP command.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

90
03:57.640 --> 04:01.520
manager is also via the IP command.

91
04:01.520 --> 04:05.360
The big distinction here though is that the changes we make here are not going

92
04:05.360 --> 04:06.120
to persist

93
04:06.120 --> 04:07.120
a reboot.

94
04:07.120 --> 04:09.640
So once again this gives us a little bit of a choice here.

95
04:09.640 --> 04:13.460
If we want to use the configuration files, well a good idea to handle this

96
04:13.460 --> 04:14.200
would be to

97
04:14.200 --> 04:17.120
actually template out these particular configurations.

98
04:17.120 --> 04:20.960
So that could be things like using the ginger to templating language.

99
04:20.960 --> 04:24.910
All we have to do is to specify which configuration fails we want to target and

100
04:24.910 --> 04:25.800
then we can effectively

101
04:25.800 --> 04:29.160
generate the configurations and push them into the correct location.

102
04:29.160 --> 04:32.700
Or if we so wish we can perhaps just make a subtle modification to a particular
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

102
04:29.160 --> 04:32.700
Or if we so wish we can perhaps just make a subtle modification to a particular

103
04:32.700 --> 04:33.520
configuration

104
04:33.520 --> 04:38.800
file utilizing one of the many utilities such as the line and file option.

105
04:38.800 --> 04:42.940
However if we just want to push out simple commands using the IP command, well

106
04:42.940 --> 04:43.400
of course

107
04:43.400 --> 04:47.440
once again we can use that same module we talked about just before.

108
04:47.440 --> 04:49.600
That is the Ansible built in command module.

109
04:49.600 --> 04:52.480
Again it's not going to be idempotent however.

110
04:52.480 --> 04:56.180
So you know all those commands that we can just run such as IP adder, IP route,

111
04:56.180 --> 04:56.600
that

112
04:56.600 --> 04:57.600
type of thing.

113
04:57.600 --> 05:01.410
As well as all the available modifications we can make with this particular
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

113
04:57.600 --> 05:01.410
As well as all the available modifications we can make with this particular

114
05:01.410 --> 05:02.080
commands.

115
05:02.080 --> 05:05.800
We can just push out those commands directly if we so wish straight from our

116
05:05.800 --> 05:06.960
Ansible Playbooks.

117
05:06.960 --> 05:11.550
Now just to make a point on the RETA Enterprise Linux distribution, if you want

118
05:11.550 --> 05:12.120
to be making

119
05:12.120 --> 05:15.630
the configuration file changes, the location you will be looking in will be in

120
05:15.630 --> 05:16.120
the Etsy

121
05:16.120 --> 05:20.670
directory and then in a directory called sysconfig and then within that we're

122
05:20.670 --> 05:21.400
going to have a

123
05:21.400 --> 05:23.400
directory called network scripts.

124
05:23.400 --> 05:28.290
Inside of here what you can do is create a new file for every single interface

125
05:28.290 --> 05:29.120
and within

126
05:29.120 --> 05:32.120
that particular file that is where the configurations would be.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

126
05:29.120 --> 05:32.120
that particular file that is where the configurations would be.

127
05:32.120 --> 05:37.200
So say for example you happen to have an interface called ens150 for example.

128
05:37.200 --> 05:42.650
The actual format you would do would be to create the file called ifcfg, hyphen

129
05:42.650 --> 05:43.000
and then

130
05:43.000 --> 05:47.120
the name of the corresponding interface so ens150 for example.

131
05:47.120 --> 05:50.240
And of course I would have to use a sub-user privileges, that type of thing.

132
05:50.240 --> 05:53.300
And then inside this particular configuration file you would just have some

133
05:53.300 --> 05:54.280
basic configurations

134
05:54.280 --> 05:58.210
specifying the name of the device and some particular options such as you know

135
05:58.210 --> 05:58.520
the IP

136
05:58.520 --> 06:02.960
address like you know 10, 10, 10, 1, that type of thing.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

136
05:58.520 --> 06:02.960
address like you know 10, 10, 10, 1, that type of thing.

137
06:02.960 --> 06:06.910
This is the type of configurations that we would template out or perhaps even

138
06:06.910 --> 06:07.360
modify

139
06:07.360 --> 06:10.560
via the line and file or block and file options.

140
06:10.560 --> 06:14.420
So as you can see there are a lot of different ways to handle networking on

141
06:14.420 --> 06:15.560
Linux and as

142
06:15.560 --> 06:19.780
such we have lots of different ways to handle this particular problem utilizing

143
06:19.780 --> 06:20.520
Ansible.

144
06:20.520 --> 06:23.690
However whilst it is important to understand all of these different ways we can

145
06:23.690 --> 06:24.080
handle

146
06:24.080 --> 06:28.170
this particular problem one way I'm really going to recommend to you is to

147
06:28.170 --> 06:28.880
utilize these

148
06:28.880 --> 06:30.840
dedicated Ansible modules.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

148
06:28.880 --> 06:30.840
dedicated Ansible modules.

149
06:30.840 --> 06:35.290
So the very first module that we're going to be looking at is the nncli module

150
06:35.290 --> 06:35.680
and well

151
06:35.680 --> 06:38.200
that's what we're talking about in the very next video.

152
06:38.200 --> 06:48.200
[BLANK_AUDIO]
