WEBVTT

1
00:00.000 --> 00:03.570
So in the previous video we learned how we could use the file system module to

2
00:03.570 --> 00:04.640
ultimately create

3
00:04.640 --> 00:10.000
as well as delete file systems on particular partitions. Now this is one way in

4
00:10.000 --> 00:10.480
which we

5
00:10.480 --> 00:14.510
can invoke this particular task but as you know we can also use things known as

6
00:14.510 --> 00:15.600
Ansible Roles.

7
00:15.600 --> 00:19.120
As we have discussed before this is going to allow us to perhaps simplify our

8
00:19.120 --> 00:20.000
playbooks

9
00:20.000 --> 00:25.120
and make them more modular. Now recall we actually have our rail system roles

10
00:25.120 --> 00:25.760
and these allow us

11
00:25.760 --> 00:29.920
to perform many different tasks say for example to perform the management of

12
00:29.920 --> 00:30.880
networking on our
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

12
00:29.920 --> 00:30.880
networking on our

13
00:30.880 --> 00:35.720
systems or even if we so wish we can utilize them to manage our storage. Now in

14
00:35.720 --> 00:37.120
a previous skill

15
00:37.120 --> 00:40.560
we actually talked about this particular role and when it came to managing

16
00:40.560 --> 00:41.360
things such as

17
00:41.360 --> 00:46.650
LVM and partitions we deemed that it was kind of underdeveloped. You know it

18
00:46.650 --> 00:47.680
just had particular

19
00:47.680 --> 00:52.670
restrictions we could for example only act on on partition disks and as such we

20
00:52.670 --> 00:54.000
kind of avoided

21
00:54.000 --> 00:58.930
this particular role. In the case of the management of file systems however

22
00:58.930 --> 01:00.320
this role is a little
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

22
00:58.930 --> 01:00.320
this role is a little

23
01:00.320 --> 01:04.240
bit more usable. So given that it is more usable and given the fact that these

24
01:04.240 --> 01:05.440
roles are red hat

25
01:05.440 --> 01:09.670
supported then I do feel it is a good idea to learn how we could manage our

26
01:09.670 --> 01:11.280
file system configurations

27
01:11.280 --> 01:15.770
directly using these roles. All I'm going to do here is if I go into user share

28
01:15.770 --> 01:16.800
doc and then

29
01:16.800 --> 01:21.010
my rail system roles directly into an LS we can see all of these other

30
01:21.010 --> 01:21.920
directories.

31
01:21.920 --> 01:24.880
The one we're going to be looking at is this one right here so I'll see the end

32
01:24.880 --> 01:25.440
of storage.

33
01:25.440 --> 01:29.280
Now again if you remember we actually don't have any example playbooks but if

34
01:29.280 --> 01:30.160
we happen to go into
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

34
01:29.280 --> 01:30.160
we happen to go into

35
01:30.160 --> 01:34.830
the readme.md file we have a whole bunch of information about how we can use

36
01:34.830 --> 01:36.000
this particular

37
01:36.000 --> 01:40.770
role but inside of this particular file we can see all of these examples of how

38
01:40.770 --> 01:42.080
to use the particular

39
01:42.080 --> 01:45.910
role but just to make things a little bit easier to read in my opinion I'm

40
01:45.910 --> 01:46.800
going to look at the

41
01:46.800 --> 01:51.180
same information directly via my web browser. So if you happen to search for

42
01:51.180 --> 01:52.320
rail system roles

43
01:52.320 --> 01:56.960
storage get up and we click this link right here. If I scroll on down we're

44
01:56.960 --> 01:57.840
going to see the same

45
01:57.840 --> 02:00.990
information that we otherwise would see but I just think this is a little bit
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

45
01:57.840 --> 02:00.990
information that we otherwise would see but I just think this is a little bit

46
02:00.990 --> 02:01.600
more readable.

47
02:01.600 --> 02:05.840
So notice we can define these particular variables we can define one known as

48
02:05.840 --> 02:07.040
storage underscore

49
02:07.040 --> 02:11.830
pools and in our case if we scroll on down a little bit further here the other

50
02:11.830 --> 02:12.480
one we can

51
02:12.480 --> 02:17.440
actually define is this one right here storage underscore volumes as it's going

52
02:17.440 --> 02:18.880
to provide us a list of

53
02:18.880 --> 02:22.280
volumes that we want to manage. Now this here is the one we're going to be

54
02:22.280 --> 02:23.440
looking at. Now we can

55
02:23.440 --> 02:26.810
see here we have some additional parameters we have the name parameter to

56
02:26.810 --> 02:28.080
specify the name of the

57
02:28.080 --> 02:31.980
volume. We can specify the type of volume we're going to be managing is it
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

57
02:28.080 --> 02:31.980
volume. We can specify the type of volume we're going to be managing is it

58
02:31.980 --> 02:33.040
going to be an LVM

59
02:33.040 --> 02:37.320
file system or is it going to be a disk or perhaps even a read array which is

60
02:37.320 --> 02:38.160
for redundancy.

61
02:38.160 --> 02:42.030
In our case right now we just want to be managing a disk. Now in the case of

62
02:42.030 --> 02:43.200
our disks we want to

63
02:43.200 --> 02:47.830
specify which disks do we want to target and we can do this via the disks

64
02:47.830 --> 02:49.120
option right here.

65
02:49.120 --> 02:54.000
So this could be safe for example in our case that would be dev forward slash N

66
02:54.000 --> 02:56.880
V M E 0 N 2 to target

67
02:56.880 --> 03:01.010
the particular disk that we were just manipulating in the previous video. Now
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

67
02:56.880 --> 03:01.010
the particular disk that we were just manipulating in the previous video. Now

68
03:01.010 --> 03:02.480
if I scroll on down

69
03:02.480 --> 03:08.050
we also have the option for our FS underscore type this is going to specify the

70
03:08.050 --> 03:09.040
desire first

71
03:09.040 --> 03:12.960
system type that we want to create so we can use things such as XFS, ext4,

72
03:12.960 --> 03:14.160
swaps based that type of

73
03:14.160 --> 03:18.810
thing and we have a whole bunch of other options within this particular role

74
03:18.810 --> 03:19.840
right now though let's

75
03:19.840 --> 03:22.950
just stick with the very basics. All I will do here is I'll take that

76
03:22.950 --> 03:24.240
information that we just

77
03:24.240 --> 03:27.690
learned and all I will do is I will create a new playbook. So let's go into

78
03:27.690 --> 03:28.800
insert mode let's

79
03:28.800 --> 03:32.940
have a name for this playbook let's just call this play two I'll just say
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

79
03:28.800 --> 03:32.940
have a name for this playbook let's just call this play two I'll just say

80
03:32.940 --> 03:35.040
testing the storage role.

81
03:35.040 --> 03:38.240
So who are we going to target this time let's just go with the yellow box for a

82
03:38.240 --> 03:38.960
little bit of a

83
03:38.960 --> 03:42.830
difference and gather facts I can also set the false once again we don't need

84
03:42.830 --> 03:43.760
them. Now what I'm

85
03:43.760 --> 03:48.100
going to do here is I'm going to define my variables that I'm going to pass in

86
03:48.100 --> 03:49.040
to my role

87
03:49.040 --> 03:53.220
so I'll specify my vars now what is the var I want to define well it's going to

88
03:53.220 --> 03:54.080
be storage

89
03:54.080 --> 03:58.000
underscore volumes and now I'm going to specify some of those parameters so I

90
03:58.000 --> 03:59.200
'll specify the name

91
03:59.200 --> 04:04.560
here such as use the name of test FS for example now I can specify the type of
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

91
03:59.200 --> 04:04.560
here such as use the name of test FS for example now I can specify the type of

92
04:04.560 --> 04:05.680
media I want to target

93
04:05.680 --> 04:09.050
it's going to be a disk and now I can specify the disks that I want to be

94
04:09.050 --> 04:10.240
targeting so I'll say

95
04:10.240 --> 04:17.230
disks and now I'm going to specify nvm e zero enter now all I will do here is

96
04:17.230 --> 04:18.880
specify the FS

97
04:18.880 --> 04:23.940
underscore type is going to be and let's maybe go with ext four this time okay

98
04:23.940 --> 04:24.480
now what I want to

99
04:24.480 --> 04:28.290
do is at the same level of indentation as my vars I'm going to use the role

100
04:28.290 --> 04:29.280
keyword and I'm just

101
04:29.280 --> 04:34.860
going to call the rail hyphen system roles dot storage so check this out if I
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

101
04:29.280 --> 04:34.860
going to call the rail hyphen system roles dot storage so check this out if I

102
04:34.860 --> 04:36.080
just save this right

103
04:36.080 --> 04:41.230
here and I go to my yellow box for a moment if I say pseudo parto dash L and

104
04:41.230 --> 04:42.480
type in my password

105
04:42.480 --> 04:47.500
here notice at the very bottom we have this unrecognized this label for dev nvm

106
04:47.500 --> 04:48.640
e zero two we do not

107
04:48.640 --> 04:53.340
have a file system here this is what we want to change so let's go back to our

108
04:53.340 --> 04:54.400
playbook and I'll

109
04:54.400 --> 04:58.900
just say answerable playbook play to that yml and hit enter open appears we

110
04:58.900 --> 05:00.080
happen to have an issue
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

110
04:58.900 --> 05:00.080
happen to have an issue

111
05:00.080 --> 05:03.770
that is because I've made a little bit of a typo this is my favorite typo to

112
05:03.770 --> 05:04.560
make I keep saying

113
05:04.560 --> 05:09.330
gather false is false that should of course be gather facts as false let's try

114
05:09.330 --> 05:10.400
that entirely

115
05:10.400 --> 05:14.620
akin arrow up and rerun the playbook so let's give us a moment to run and as

116
05:14.620 --> 05:15.840
you can see this role

117
05:15.840 --> 05:20.450
executes a rather large playbook we have 17 oks with two changes we have no

118
05:20.450 --> 05:22.240
failures and 15 skip

119
05:22.240 --> 05:26.640
check this out then so let's go back to our device if I add up and check my

120
05:26.640 --> 05:27.360
information once

121
05:27.360 --> 05:31.980
again now we can see this particular device here dev nvm e zero and two has
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

121
05:27.360 --> 05:31.980
again now we can see this particular device here dev nvm e zero and two has

122
05:31.980 --> 05:33.120
been formatted

123
05:33.120 --> 05:37.680
with an ext four based file system all via the use of an answerable storage

124
05:37.680 --> 05:38.080
role
