WEBVTT

1
00:00.000 --> 00:02.640
So friends, let's walk through the solution.

2
00:02.640 --> 00:06.080
So the very first thing I did was add a new disc to one of my devices.

3
00:06.080 --> 00:08.720
The device I chose was my Blue Box device.

4
00:08.720 --> 00:11.600
We can see it right here. If I don't lsblk-f,

5
00:11.600 --> 00:15.360
here is the device right here. Nvme 0.0.

6
00:15.360 --> 00:18.480
So what I'm going to do is I'm going to write a playbook that will use the file

7
00:18.480 --> 00:19.120
system module

8
00:19.120 --> 00:22.160
to format this new disc with the ext4 file system.

9
00:22.160 --> 00:26.240
So let me create a playbook which is called this validation1.YMLGUNT

10
00:26.240 --> 00:29.560
and set mode have my three hyphens at the top. Give the playbook a name and let

11
00:29.560 --> 00:30.320
's just call this
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

11
00:29.560 --> 00:30.320
's just call this

12
00:30.320 --> 00:33.960
validation1. Here I'm going to target and I'm going to target my Blue Box. I

13
00:33.960 --> 00:34.480
will set

14
00:34.480 --> 00:38.400
gather facts to be false. And now I'm going to define my tasks.

15
00:38.400 --> 00:42.320
So the task is going to be create an ext4 file system.

16
00:42.320 --> 00:46.680
So I'm going to use the community general file system module and the device I

17
00:46.680 --> 00:47.440
'll target will be

18
00:47.440 --> 00:52.510
nvme 0.0 into the device that I just created and the file system type is going

19
00:52.510 --> 00:54.640
to be ext4.

20
00:54.640 --> 00:59.200
So if I just press escape colon wq to write and quit and I just say answer

21
00:59.200 --> 01:03.600
playbook validation1.YML and to enter give it a moment and as we can see we
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

21
00:59.200 --> 01:03.600
playbook validation1.YML and to enter give it a moment and as we can see we

22
01:03.600 --> 01:04.480
have made the change.

23
01:04.480 --> 01:09.360
Let's go to our device. If I do an lsblk-f now we can see here we have

24
01:09.360 --> 01:10.880
successfully formatted

25
01:10.880 --> 01:15.200
that particular disc with the ext4 file system. So now what I need to do is I

26
01:15.200 --> 01:15.920
need to write a

27
01:15.920 --> 01:20.130
second playbook that is going to create a new directory called validation_der

28
01:20.130 --> 01:20.560
and the user's

29
01:20.560 --> 01:24.960
home directory. So let's create a new playbook called validation2.YML. I'm

30
01:24.960 --> 01:25.840
going to insert mode,

31
01:25.840 --> 01:29.030
have our three high fins, give the playbook a name. I'll just call it

32
01:29.030 --> 01:30.400
validation2. Again we'll
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

32
01:29.030 --> 01:30.400
validation2. Again we'll

33
01:30.400 --> 01:34.460
target the same device as before in my case here the blue box. I'll set gather

34
01:34.460 --> 01:35.840
facts to be false

35
01:35.840 --> 01:39.920
and now I'll specify my tasks. Now the first task here is going to be creating

36
01:39.920 --> 01:40.800
a mount point.

37
01:40.800 --> 01:44.570
So I'll say create a new dir for mounting. I'm going to use the answerable

38
01:44.570 --> 01:46.080
built-in file module

39
01:46.080 --> 01:49.200
and the path this time is going to be in the user's home directory as I'll say

40
01:49.200 --> 01:50.160
forward slash home

41
01:50.160 --> 01:54.960
in my case here I have nugget user and the name of directory is going to be

42
01:54.960 --> 01:57.280
validation_der.

43
01:57.280 --> 02:00.960
Now specify the state is going to be a directory and I'll give it the mode
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

43
01:57.280 --> 02:00.960
Now specify the state is going to be a directory and I'll give it the mode

44
02:00.960 --> 02:02.080
which is maybe go with

45
02:02.080 --> 02:05.620
or I don't know let's go with 075. So that's going to create the actual

46
02:05.620 --> 02:06.960
directory but that is not all

47
02:06.960 --> 02:10.610
we're going to also have to mount the newly created file system in this

48
02:10.610 --> 02:12.080
directory and ensure that

49
02:12.080 --> 02:17.030
the file system is mounted immediately and will persist across system reboots.

50
02:17.030 --> 02:17.840
So the next task

51
02:17.840 --> 02:21.830
I'm going to create will just say mount the device. I will use the answerable

52
02:21.830 --> 02:22.960
POSIX mount module

53
02:22.960 --> 02:27.810
or specify the path that I'm going to use it's going to be the home nugget user

54
02:27.810 --> 02:28.400
and it's going to

55
02:28.400 --> 02:33.650
be the validation_der directed that I'm going to use. Now specify the source is
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

55
02:28.400 --> 02:33.650
be the validation_der directed that I'm going to use. Now specify the source is

56
02:33.650 --> 02:35.440
going to be forward slash

57
02:35.440 --> 02:43.800
dev nve 0 enter the fstype is going to be ext4 this time and state we want to

58
02:43.800 --> 02:44.960
specify as mounted

59
02:44.960 --> 02:48.970
because that will mount immediately and also modify it's the fstype to ensure

60
02:48.970 --> 02:50.080
persistence. So let's

61
02:50.080 --> 02:54.360
just write and quit and we'll try running this new playbook right here and to

62
02:54.360 --> 02:56.080
enter give it a moment

63
02:56.080 --> 03:00.440
we create the new directory and mount the device. So let's go to our blue box
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

63
02:56.080 --> 03:00.440
we create the new directory and mount the device. So let's go to our blue box

64
03:00.440 --> 03:01.600
once again if I don't

65
03:01.600 --> 03:06.810
lsbok-f we can see here we have our device right here and it has successfully

66
03:06.810 --> 03:08.320
mounted in the target

67
03:08.320 --> 03:13.520
directory and also just to ensure persistence if I check my @sfs-tab file we

68
03:13.520 --> 03:15.040
also have the entry

69
03:15.040 --> 03:18.470
right here. So that is us for our validation challenge I hope this has been

70
03:18.470 --> 03:19.360
informative for

71
03:19.360 --> 03:21.360
you and I'd like to thank you for viewing.
