WEBVTT

1
00:00.000 --> 00:04.320
So friends, let's discuss the game plan to setting up our own local repository

2
00:04.320 --> 00:05.200
here on the control

3
00:05.200 --> 00:08.850
node. So here it is right here. This is our Ansible server. Okay. And again, we

4
00:08.850 --> 00:10.000
have our blue box

5
00:10.000 --> 00:14.030
and our yellow box. So a few things have got to happen in order for this to

6
00:14.030 --> 00:15.440
correctly operate.

7
00:15.440 --> 00:18.750
So the very first thing I'm going to have to do is to install two different

8
00:18.750 --> 00:19.280
packages.

9
00:19.280 --> 00:24.140
One package is going to be for an FTP server, because basically this is how we

10
00:24.140 --> 00:24.800
're going to

11
00:24.800 --> 00:29.170
set the server up so that these client devices, say for example, the blue box,

12
00:29.170 --> 00:29.840
when we have

13
00:29.840 --> 00:35.110
configured this device to use the control node as a valid repository, we are
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

13
00:29.840 --> 00:35.110
configured this device to use the control node as a valid repository, we are

14
00:35.110 --> 00:35.840
going to be pulling

15
00:35.840 --> 00:40.570
down the packages over FTP. So this server here actually has to be configured

16
00:40.570 --> 00:41.360
with the FTP

17
00:41.360 --> 00:45.080
daemon. So that is something we're going to have to install straight away. And

18
00:45.080 --> 00:46.000
also, so that we

19
00:46.000 --> 00:51.250
can create the necessary metadata so that DNF or YUM from these devices over

20
00:51.250 --> 00:52.000
here, so that they

21
00:52.000 --> 00:55.760
can actually understand what the server is serving up. We're going to have to

22
00:55.760 --> 00:56.320
run a very

23
00:56.320 --> 01:01.390
particular command known as create repo. Now this command is not available on a
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

23
00:56.320 --> 01:01.390
particular command known as create repo. Now this command is not available on a

24
01:01.390 --> 01:02.800
default installation.

25
01:02.800 --> 01:05.810
So we're going to have to install a package which gives us access to that

26
01:05.810 --> 01:06.960
command. So we'll have to

27
01:06.960 --> 01:11.360
install those two things, the server as well as the package which houses that

28
01:11.360 --> 01:12.800
command. Now with the

29
01:12.800 --> 01:17.140
FTP server installed on the system, the next thing we want to do is to start

30
01:17.140 --> 01:18.000
that particular

31
01:18.000 --> 01:22.070
server so that it is operational. Now think about it once the server is started

32
01:22.070 --> 01:23.040
and up and running,

33
01:23.040 --> 01:27.280
we want to be able to accept incoming connections straight away, you should be

34
01:27.280 --> 01:28.080
thinking, we're going

35
01:28.080 --> 01:32.710
to have to have some firewall considerations because ordinarily that port would
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

35
01:28.080 --> 01:32.710
to have to have some firewall considerations because ordinarily that port would

36
01:32.710 --> 01:33.680
just be blocked.

37
01:33.680 --> 01:37.300
So we'll also have to open up that particular port for that particular service.

38
01:37.300 --> 01:37.840
Then the next

39
01:37.840 --> 01:42.360
thing we want to do is to actually create a directory on the server itself that

40
01:42.360 --> 01:43.520
is going to be used

41
01:43.520 --> 01:47.620
as the repository itself. So if anyone accesses that directory, this is where

42
01:47.620 --> 01:48.560
all the packages

43
01:48.560 --> 01:51.910
are going to reside. And then we want to download some packages. Say for

44
01:51.910 --> 01:53.360
example, in our case here,

45
01:53.360 --> 01:56.880
we will use an engine X server for the demonstration. So that we actually have

46
01:56.880 --> 01:57.920
the package available

47
01:57.920 --> 02:02.460
on the system. And then we can put the package inside of our repo directory so
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

47
01:57.920 --> 02:02.460
on the system. And then we can put the package inside of our repo directory so

48
02:02.460 --> 02:03.440
that when anyone

49
02:03.440 --> 02:07.400
goes to use our particular repository, say for example, the blue box looking

50
02:07.400 --> 02:08.560
for engine X,

51
02:08.560 --> 02:12.810
they're going to be able to find it within our specially designated directory.

52
02:12.810 --> 02:13.280
Now like I say,

53
02:13.280 --> 02:17.200
we're going to have this directory, but in order to actually transform this

54
02:17.200 --> 02:18.160
otherwise regular

55
02:18.160 --> 02:22.960
directory into a fully blown repo directory, we actually want to run that

56
02:22.960 --> 02:24.240
particular command

57
02:24.240 --> 02:28.700
that we just installed, the create repo commands against this newly created

58
02:28.700 --> 02:29.920
directory. And with

59
02:29.920 --> 02:34.060
that in play, the server will be up and running. So with the server all set up,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

59
02:29.920 --> 02:34.060
that in play, the server will be up and running. So with the server all set up,

60
02:34.060 --> 02:34.640
the next thing we

61
02:34.640 --> 02:39.900
want to do is actually to install an FTP client on both of our managed devices.

62
02:39.900 --> 02:40.560
Because if we have

63
02:40.560 --> 02:45.090
an FTP client on the devices, then they can begin making a quest to the FTP

64
02:45.090 --> 02:46.320
server. Now it's not

65
02:46.320 --> 02:50.470
enough just to have FTP on our device. What we're also going to do is to use

66
02:50.470 --> 02:51.520
that module we just

67
02:51.520 --> 02:56.240
talked about in the previous video, the yum_reportatory module to basically

68
02:56.240 --> 02:58.240
tell our local systems where

69
02:58.240 --> 03:02.580
they should actually look on the server to find all the packages, ie which
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

69
02:58.240 --> 03:02.580
they should actually look on the server to find all the packages, ie which

70
03:02.580 --> 03:03.920
directory should we be looking

71
03:03.920 --> 03:07.520
for. So this is a process that we have to walk through. Let's begin with the

72
03:07.520 --> 03:08.560
server configuration

73
03:08.560 --> 03:11.330
then. So what I will do here is I will just create a new playbook and let's

74
03:11.330 --> 03:13.520
call this play3.yml.

75
03:13.520 --> 03:16.820
Going to insert mode, have a three hyphens at the top and I'll just say

76
03:16.820 --> 03:19.760
configure server to be repo.

77
03:19.760 --> 03:23.930
Now pop quiz, what should I actually configure for the host here? It's not

78
03:23.930 --> 03:24.960
going to be the blue box

79
03:24.960 --> 03:28.830
or the yellow box, but actually going to add on ourselves the local host in

80
03:28.830 --> 03:30.240
this case. Okay.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

80
03:28.830 --> 03:30.240
this case. Okay.

81
03:30.240 --> 03:35.680
Next I'll say gather facts to be false. And now I'm going to define my tasks.

82
03:35.680 --> 03:36.480
So here is the first

83
03:36.480 --> 03:41.550
task or the set install necessary packages. Now what I will use here is the Ans

84
03:41.550 --> 03:42.720
ible built-in

85
03:42.720 --> 03:47.280
dnf module. Again, if you want to use yum, feel free. And now specify the names

86
03:47.280 --> 03:48.160
of the packages

87
03:48.160 --> 03:51.380
that I want to install me because it's going to be more than one. I'm going to

88
03:51.380 --> 03:52.080
use an array. So

89
03:52.080 --> 03:57.710
we have our hyphen here. And the first package is going to be vs ftp_d. This is

90
03:57.710 --> 03:58.720
the FTP daemon

91
03:58.720 --> 04:02.740
that we want to use to run the FTP server. Next we're going to install the
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

91
03:58.720 --> 04:02.740
that we want to use to run the FTP server. Next we're going to install the

92
04:02.740 --> 04:05.360
create repo underscore

93
04:05.360 --> 04:09.070
c package, giving us access to that particular command that we need. And then I

94
04:09.070 --> 04:09.840
'll specify that

95
04:09.840 --> 04:14.480
the state is going to be present. So once we have FTP installed on the system,

96
04:14.480 --> 04:15.600
we want to start

97
04:15.600 --> 04:20.390
the FTP server. So I will use the Ansible built-in service module. And the name

98
04:20.390 --> 04:21.200
of the service that

99
04:21.200 --> 04:26.390
I want to be configuring here is vs ftp_d. And now I'll specify that the state

100
04:26.390 --> 04:27.040
is going to be

101
04:27.040 --> 04:31.770
started. So we actually started. And then I'll set enabled to be yes. That
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

101
04:27.040 --> 04:31.770
started. So we actually started. And then I'll set enabled to be yes. That

102
04:31.770 --> 04:32.320
means that if we

103
04:32.320 --> 04:36.060
happen to reboot the system, then the server is going to automatically start up

104
04:36.060 --> 04:36.720
. After all,

105
04:36.720 --> 04:40.280
if we're going to run a repository, we want the repository to be available.

106
04:40.280 --> 04:40.960
Next time we'll just

107
04:40.960 --> 04:45.730
take and figure the firewall to allow FTP communication. So this time I'm going

108
04:45.730 --> 04:46.960
to use the Ansible

109
04:46.960 --> 04:51.760
POSIX firewall d module, and now specify the service I want to be configuring.

110
04:51.760 --> 04:52.400
So the service

111
04:52.400 --> 04:57.550
is going to be FTP, I'll specify that the state is going to be enabled. And I

112
04:57.550 --> 04:58.800
want this to persist

113
04:58.800 --> 05:02.870
reboot source a permanent is equal to yes. And that should open up the firewall
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

113
04:58.800 --> 05:02.870
reboot source a permanent is equal to yes. And that should open up the firewall

114
05:02.870 --> 05:03.680
. So the next thing

115
05:03.680 --> 05:07.840
I will do will be to create the directory for the repository. And now I'll use

116
05:07.840 --> 05:09.120
the Ansible built-in

117
05:09.120 --> 05:13.710
file module. Now specify the path. The path I'm going to specify here is going

118
05:13.710 --> 05:14.880
to be forward slash

119
05:14.880 --> 05:20.570
var forward slash FTP. And then I can give any name I so wish. Now strictly, we

120
05:20.570 --> 05:21.120
don't actually

121
05:21.120 --> 05:25.120
have to use this particular path here. But this is a common convention. The var

122
05:25.120 --> 05:25.920
directory after

123
05:25.920 --> 05:29.260
all is used to house files, which are going to be variable in size, such as you

124
05:29.260 --> 05:30.480
know, packages or
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

124
05:29.260 --> 05:30.480
know, packages or

125
05:30.480 --> 05:34.340
log files that type of thing. So it makes sense to put our FTP configuration

126
05:34.340 --> 05:35.360
within that particular

127
05:35.360 --> 05:40.000
directory. And then like I say, we can choose any name we so wish. So my case

128
05:40.000 --> 05:41.040
here, I would just say

129
05:41.040 --> 05:45.770
forward slash var forward slash FTP and let's just call this local repository.

130
05:45.770 --> 05:46.320
And then I want to

131
05:46.320 --> 05:50.030
specify that the state is going to be a directory. And now I'm going to

132
05:50.030 --> 05:52.160
download the engine X package,

133
05:52.160 --> 05:55.350
because basically this is going to be a package that I want to be able to serve

134
05:55.350 --> 05:56.640
up to my network.

135
05:56.640 --> 05:59.960
And again, how am I going to get that package? I can use the Ansible built-in D

136
05:59.960 --> 06:00.800
NF module once
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

136
05:59.960 --> 06:00.800
NF module once

137
06:00.800 --> 06:04.900
again, I specify that the name is going to be engine X. So let's now briefly go

138
06:04.900 --> 06:05.680
to the Ansible

139
06:05.680 --> 06:09.800
built-in DNF module page. We're going to look at two parameters. We actually

140
06:09.800 --> 06:10.720
haven't used yet.

141
06:10.720 --> 06:13.700
So let's scroll on down a little bit here. Here they are right here. Okay. Here

142
06:13.700 --> 06:14.400
is the download

143
06:14.400 --> 06:18.080
directory. This is going to take a string value. And this is going to allow us

144
06:18.080 --> 06:18.880
to specify an

145
06:18.880 --> 06:23.340
alternative directory, whereby we're going to store packages. Now this is only

146
06:23.340 --> 06:24.080
going to take an

147
06:24.080 --> 06:28.050
effect. If you have to specify the download only parameter, which is the one

148
06:28.050 --> 06:29.120
below we want to look

149
06:29.120 --> 06:33.420
at, this one is just going to be a billion value, either true or false. And
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

149
06:29.120 --> 06:33.420
at, this one is just going to be a billion value, either true or false. And

150
06:33.420 --> 06:34.400
what this option is going

151
06:34.400 --> 06:38.120
to do, it's going to specify that we download the package, but do not install

152
06:38.120 --> 06:39.280
them, which makes

153
06:39.280 --> 06:42.800
sense because you want to download the package so that we can effectively serve

154
06:42.800 --> 06:43.520
it up to other

155
06:43.520 --> 06:48.320
users. We don't necessarily want to say, for example, install an engine X7 on

156
06:48.320 --> 06:49.600
our own local system.

157
06:49.600 --> 06:54.000
We just want to host that package. So let's go and add these in. So specify the

158
06:54.000 --> 06:54.560
download

159
06:54.560 --> 06:58.600
underscore there is going to be where do you think it's going to be in var and

160
06:58.600 --> 06:59.680
then in the local

161
06:59.680 --> 07:04.320
repository directory, we just created above. And then I'll specify download
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

161
06:59.680 --> 07:04.320
repository directory, we just created above. And then I'll specify download

162
07:04.320 --> 07:05.360
only and then set

163
07:05.360 --> 07:09.390
that to the billion value of true. Next, the final task is going to be use the

164
07:09.390 --> 07:10.720
create repo commands

165
07:10.720 --> 07:14.080
on the directory. So in the case here, we're just going to use the answerable

166
07:14.080 --> 07:16.000
built in command module

167
07:16.000 --> 07:20.910
with the CMD parameter. And the command we want to run is going to be create

168
07:20.910 --> 07:22.160
repo or one word.

169
07:22.160 --> 07:25.700
And then we just specify the name of the directory we want to target, which is

170
07:25.700 --> 07:26.560
going to be var

171
07:26.560 --> 07:33.510
FTP local repository. So let's save this right and quit. And now let's run the
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

171
07:26.560 --> 07:33.510
FTP local repository. So let's save this right and quit. And now let's run the

172
07:33.510 --> 07:34.480
playbook. And the

173
07:34.480 --> 07:38.990
playbook kicks off and we install the necessary packages and the playbook

174
07:38.990 --> 07:40.320
completes. So now if

175
07:40.320 --> 07:46.590
I go into my var FTP directory and on LS, we now have this local repository. If

176
07:46.590 --> 07:47.840
I go inside of here,

177
07:47.840 --> 07:51.330
and I do a listing, this here is our download folder. So everything that we

178
07:51.330 --> 07:52.240
downloaded is now

179
07:52.240 --> 07:56.730
present. And because we run that create repo command, we also have this repo

180
07:56.730 --> 07:57.600
data directory

181
07:57.600 --> 08:01.830
who go inside of here, the LS, we have all this information here that can
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

181
07:57.600 --> 08:01.830
who go inside of here, the LS, we have all this information here that can

182
08:01.830 --> 08:03.440
ultimately be used by

183
08:03.440 --> 08:07.450
DNF or by Yum, whoever is trying to consume us as a repository. So one last

184
08:07.450 --> 08:08.400
thing I want to do

185
08:08.400 --> 08:13.590
right now is to go into the Etsy directory, I'm going to VS FDPD, and then VS F

186
08:13.590 --> 08:15.840
DPD.conf. If I go in here,

187
08:15.840 --> 08:19.200
going to insert mode, all I'm going to do here is because for any lab

188
08:19.200 --> 08:20.480
environment, I'm going to

189
08:20.480 --> 08:25.280
copy out this particular configuration saying anonymous enable no. Basically,

190
08:25.280 --> 08:25.840
this will allow

191
08:25.840 --> 08:29.780
people to access our FTP server without having to specify particular

192
08:29.780 --> 08:31.760
credentials, quite simply
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

192
08:29.780 --> 08:31.760
credentials, quite simply

193
08:31.760 --> 08:35.900
allowing an anonymous login. So let's just write and quit. And all I want to do

194
08:35.900 --> 08:36.560
here is to say

195
08:36.560 --> 08:43.600
sudo systemctl restart VS FDPD and to enter to redin those new configurations.

196
08:43.600 --> 08:44.080
So what's the

197
08:44.080 --> 08:47.760
server now up and running? How about we go and begin configuring our client?
