WEBVTT

1
00:00.000 --> 00:03.120
So friends let's walk through the solution now. So what I will do is I'll

2
00:03.120 --> 00:03.920
create a playbook

3
00:03.920 --> 00:08.410
and I'll just call this one let's just say LVM conf dot yml. So we're going to

4
00:08.410 --> 00:08.960
insert mode,

5
00:08.960 --> 00:12.210
have our three hyphens at the top, let's get this playbook in name, and I'll

6
00:12.210 --> 00:13.920
just say configure LVM.

7
00:13.920 --> 00:17.070
Now here we're going to target, we're going to target the test group. And in

8
00:17.070 --> 00:17.680
this case here I'm

9
00:17.680 --> 00:20.850
going to set gather facts to be false, we don't actually need them, so why use

10
00:20.850 --> 00:21.840
them. Now the very

11
00:21.840 --> 00:24.460
first thing that I'm going to have to do is to create a volume group. So let me

12
00:24.460 --> 00:24.880
just check

13
00:24.880 --> 00:29.220
something if I go into my device number one right here, if I just send LSBLK

14
00:29.220 --> 00:30.240
dash f, we can actually
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

14
00:29.220 --> 00:30.240
dash f, we can actually

15
00:30.240 --> 00:35.210
see here I have this disk right here, NVMe0n2, this is the disk that I'm going

16
00:35.210 --> 00:36.160
to target and

17
00:36.160 --> 00:41.330
effectively put into my volume group. So let's just escape back out, go back

18
00:41.330 --> 00:42.320
into my playbook,

19
00:42.320 --> 00:46.710
and now I'll begin defining my tasks. Okay, so I'll give this task in name, and

20
00:46.710 --> 00:47.440
I'll just say

21
00:47.440 --> 00:51.760
creates a volume group. Now here's what I want to do, I want to utilize a very

22
00:51.760 --> 00:52.640
particular module.

23
00:52.640 --> 00:57.350
So if I say Ansible.doc dash dash list to see all of my available modules that

24
00:57.350 --> 00:58.240
I have right here,

25
00:58.240 --> 01:02.710
if I do a forward slash and I search for LVG and then hit end to go to the next
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

25
00:58.240 --> 01:02.710
if I do a forward slash and I search for LVG and then hit end to go to the next

26
01:02.710 --> 01:03.440
, we can see here I

27
01:03.440 --> 01:07.010
have this module community general LVG that sounds like it might be what we

28
01:07.010 --> 01:08.160
want. So what I will do

29
01:08.160 --> 01:11.940
here is just copy this, okay, grab here, I'll press Q to quit, let's close the

30
01:11.940 --> 01:12.640
screen and I'll

31
01:12.640 --> 01:16.760
say Ansible.doc and just paste it in that particular module. Now it says here

32
01:16.760 --> 01:18.000
this module creates,

33
01:18.000 --> 01:21.960
removes or resizes volume groups, that sounds like exactly what we would like

34
01:21.960 --> 01:22.480
to do. So

35
01:22.480 --> 01:26.020
if you go down to the bottom here, we should see some examples. So we've got

36
01:26.020 --> 01:27.200
some keywords such as

37
01:27.200 --> 01:31.290
VG allows us to specify the actual volume group we want to create. PBS allows
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

37
01:27.200 --> 01:31.290
VG allows us to specify the actual volume group we want to create. PBS allows

38
01:31.290 --> 01:32.720
us to specify which

39
01:32.720 --> 01:36.070
physical devices we want to belong to this particular volume group. And this

40
01:36.070 --> 01:37.040
seems like kind of what

41
01:37.040 --> 01:40.530
we want to do. So let's just go and grab one of these examples right here, to

42
01:40.530 --> 01:41.680
copy this right here,

43
01:41.680 --> 01:46.480
press Q to quit, let's go back in to my playbook right here. And all I will do

44
01:46.480 --> 01:46.880
is I'm going to

45
01:46.880 --> 01:50.970
insert mode or to paste this example in. Now if I just fix the indentation here

46
01:50.970 --> 01:51.600
, and all I will do

47
01:51.600 --> 01:55.350
is I'll get rid of this name right here. Okay, so like I say VG is going to

48
01:55.350 --> 01:56.560
allow us to specify

49
01:56.560 --> 01:59.680
what our volume group is actually called, and it should actually be called nug

50
01:59.680 --> 02:00.560
get storage I believe,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

50
01:59.680 --> 02:00.560
get storage I believe,

51
02:00.560 --> 02:04.510
let me just double check that. Yep, nugget storage right there. Now I specify

52
02:04.510 --> 02:05.600
my physical volumes I

53
02:05.600 --> 02:10.620
want to use. So in my case here, it's going to be dev nvm e zero n two. Now if

54
02:10.620 --> 02:11.600
this is a different

55
02:11.600 --> 02:15.520
value for you on your machine, by all means putting the correct value. So that

56
02:15.520 --> 02:16.880
should create our

57
02:16.880 --> 02:21.360
volume group, what we now want to do is to create a logical volume within. So I

58
02:21.360 --> 02:22.080
'm just going right

59
02:22.080 --> 02:25.450
this correctly. There we go. And once again, if I am to list by modules, if I

60
02:25.450 --> 02:26.320
just do forward slash

61
02:26.320 --> 02:30.150
and I begin searching for logical and to enter, we can see here in the
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

61
02:26.320 --> 02:30.150
and I begin searching for logical and to enter, we can see here in the

62
02:30.150 --> 02:31.840
description for this particular

63
02:31.840 --> 02:35.150
module, this is going to configure an LVM volume and we can't have to see the

64
02:35.150 --> 02:36.240
details. So let's go

65
02:36.240 --> 02:40.720
in to the actual module itself. Let's copy here, press Q to quit, once you

66
02:40.720 --> 02:42.560
answer the dot and paste

67
02:42.560 --> 02:46.190
in this module, so let's go in here. It says here, this is going to allow us to

68
02:46.190 --> 02:47.200
create, remove or

69
02:47.200 --> 02:50.920
resize logical volumes bingo. This is exactly what you want. So again, you can

70
02:50.920 --> 02:51.840
go through all of the

71
02:51.840 --> 02:55.330
parameters, how to use this particular module, but again, one of the best ways

72
02:55.330 --> 02:56.240
to do so any time

73
02:56.240 --> 02:59.580
driven situation is to look at the examples right here and see if it actually

74
02:59.580 --> 03:00.640
helps us. So we can
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

74
02:59.580 --> 03:00.640
helps us. So we can

75
03:00.640 --> 03:03.940
see here as per the example, this is going to allow us to create a logical

76
03:03.940 --> 03:05.280
volume of 512 megs.

77
03:05.280 --> 03:09.360
So let's grab this as a general little template right here, copy a year and I

78
03:09.360 --> 03:10.160
'll just press Q to

79
03:10.160 --> 03:14.230
quit, go back into my little playbook here, going to insert mode and I'll just

80
03:14.230 --> 03:15.840
paste in this particular

81
03:15.840 --> 03:19.260
one and all I'll do is just fix the indentation once again. Okay, so let's just

82
03:19.260 --> 03:19.920
fix some of the

83
03:19.920 --> 03:24.290
details here, we're going to create a logical volume of let's maybe say 100 me

84
03:24.290 --> 03:25.120
gs and what is the

85
03:25.120 --> 03:27.910
volume group I want to use? Well, I want to use the nuggets storage volume

86
03:27.910 --> 03:28.960
group that I just created

87
03:28.960 --> 03:32.860
above and the logical volume here should actually be called vol one as per the
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

87
03:28.960 --> 03:32.860
above and the logical volume here should actually be called vol one as per the

88
03:32.860 --> 03:33.840
instructions and it

89
03:33.840 --> 03:37.980
should be of the size 100 megs. Let's just say 100. So let's just copy this

90
03:37.980 --> 03:38.880
here since we have

91
03:38.880 --> 03:42.110
this configured and let's go all the way to the margin and we'll just paste

92
03:42.110 --> 03:42.880
this in and it should

93
03:42.880 --> 03:46.030
keep the same indentation as we see right here. Let's just go modify these

94
03:46.030 --> 03:48.000
details changes to 200.

95
03:48.000 --> 03:51.510
The same volume group should be targeted this time though the new logical

96
03:51.510 --> 03:52.560
volume should be called

97
03:52.560 --> 03:57.260
vol two and it should be of size 200 megs. So that is going to allow us to

98
03:57.260 --> 03:58.400
create our volume

99
03:58.400 --> 04:02.090
group as well as our logical volumes. What we now want to do is we want to
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

99
03:58.400 --> 04:02.090
group as well as our logical volumes. What we now want to do is we want to

100
04:02.090 --> 04:03.440
effectively put a

101
04:03.440 --> 04:07.360
file system on both of these volumes. The first one should get ext4 and the

102
04:07.360 --> 04:08.560
second one should get

103
04:08.560 --> 04:12.750
XFS. So once again, if I just go to my answerable documentation, if I do a

104
04:12.750 --> 04:14.160
forward slash and I set

105
04:14.160 --> 04:18.530
for file system and the answer hit the letter n to go to the next one. And

106
04:18.530 --> 04:20.320
again, we can see here

107
04:20.320 --> 04:23.510
this particular module here is going to make a file system. So community

108
04:23.510 --> 04:24.400
general file system,

109
04:24.400 --> 04:28.330
let's grab this one right here then. So it'll say answerable dash dot paste

110
04:28.330 --> 04:29.680
this in and hit enter

111
04:29.680 --> 04:32.940
we see this is going to create a file system and again we have access to all of
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

111
04:29.680 --> 04:32.940
we see this is going to create a file system and again we have access to all of

112
04:32.940 --> 04:33.680
the available

113
04:33.680 --> 04:37.210
options that we need. Now let's just go down to some examples right here again.

114
04:37.210 --> 04:37.920
Let's grab this

115
04:37.920 --> 04:41.470
particular example right here. Okay, let's just copy this press Q to quit. Let

116
04:41.470 --> 04:42.400
's go back into our

117
04:42.400 --> 04:46.190
playbook and scroll all the way down. Let's go to the margin once again and

118
04:46.190 --> 04:47.360
just paste this in and

119
04:47.360 --> 04:50.920
now let's just fix our indentation. So the first thing I will do is create the

120
04:50.920 --> 04:52.000
ext4 file system

121
04:52.000 --> 04:56.520
on vol one. So the file system type is going to be ext4. Now the actual device

122
04:56.520 --> 04:57.360
here the way you can

123
04:57.360 --> 05:01.220
actually reference this if you recall with respect to LVM is we say forward
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

123
04:57.360 --> 05:01.220
actually reference this if you recall with respect to LVM is we say forward

124
05:01.220 --> 05:02.400
slash dev to get the

125
05:02.400 --> 05:06.420
device no changes there. And then inside of this we're going to have our volume

126
05:06.420 --> 05:07.200
group which in this

127
05:07.200 --> 05:11.250
case here is nugget storage. So I would say nugget storage and then inside of

128
05:11.250 --> 05:12.320
here we specify the

129
05:12.320 --> 05:16.820
actual logical volume which in this case here is just vol one. So we say vol

130
05:16.820 --> 05:17.840
one and this can be

131
05:17.840 --> 05:21.580
a path right here. So let's go and actually put this in then so back into

132
05:21.580 --> 05:22.560
insert mode and we'll

133
05:22.560 --> 05:27.130
just say nugget storage and then I'll say vol one and all that we'll do is I'll

134
05:27.130 --> 05:28.000
copy all of this

135
05:28.000 --> 05:32.360
right here again copy it let's go to the margin and just paste this in again
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

135
05:28.000 --> 05:32.360
right here again copy it let's go to the margin and just paste this in again

136
05:32.360 --> 05:33.920
make the modifications

137
05:33.920 --> 05:37.340
I'll just say create XFS. I should actually add file system on this to make it

138
05:37.340 --> 05:37.760
a little bit

139
05:37.760 --> 05:42.310
more descriptive XFS file system on vol number two. So all I will do is modify

140
05:42.310 --> 05:43.200
the values this

141
05:43.200 --> 05:48.100
will maybe XFS and this particular path will be changed to vol number two. So

142
05:48.100 --> 05:48.960
if I just save this

143
05:49.520 --> 05:53.220
and all I will do is I'll say answer my playbook LVM conf and hit enter give it

144
05:53.220 --> 05:54.160
a moment we create

145
05:54.160 --> 05:58.120
the VG and then the logical volumes and then create the file systems. Now what

146
05:58.120 --> 05:59.040
I will do is I'll go

147
05:59.040 --> 06:02.900
enter my device let's say device number one and if I do an LSBLK-F we can
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

147
05:59.040 --> 06:02.900
enter my device let's say device number one and if I do an LSBLK-F we can

148
06:02.900 --> 06:04.480
actually see here

149
06:04.480 --> 06:08.680
we have our storage as our LVM storage on this particular disk we have the nug

150
06:08.680 --> 06:10.000
get story volume one

151
06:10.000 --> 06:15.040
it is an ext4 based file system whereas the volume two actually is an XFS based

152
06:15.040 --> 06:15.840
file system and once

153
06:15.840 --> 06:20.000
again if I say so though LVS we can see we have our volume group with the

154
06:20.000 --> 06:21.440
logical volume within

155
06:21.440 --> 06:26.270
volume one and it is of size 100 meg whereas the second logical volume volume

156
06:26.270 --> 06:27.120
two within the

157
06:27.120 --> 06:31.040
nugget story volume group has a size of 200 meg.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

157
06:27.120 --> 06:31.040
nugget story volume group has a size of 200 meg.
