WEBVTT

1
00:00.000 --> 00:04.590
So friends in the previous video we learned how we could create our own Ansible

2
00:04.590 --> 00:05.200
roles.

3
00:05.200 --> 00:08.960
In this particular video we're going to learn how we can consume the roles

4
00:08.960 --> 00:10.400
created by others.

5
00:10.400 --> 00:15.120
So with that said let's just get to it. So all I've done is search for Ansible

6
00:15.120 --> 00:16.000
Galaxy here and

7
00:16.000 --> 00:19.960
if I click on this link this here is effectively the marketplace that I was

8
00:19.960 --> 00:21.040
telling you about

9
00:21.040 --> 00:25.000
whereby we can easily access other roles created by other Ansible community

10
00:25.000 --> 00:25.520
members.

11
00:25.520 --> 00:29.920
So if I just go down to roles right here and click on this as we can see here

12
00:29.920 --> 00:30.560
we have a whole
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

12
00:29.920 --> 00:30.560
we have a whole

13
00:30.560 --> 00:33.960
bunch of other roles we can see when it was last updated this one here is going

14
00:33.960 --> 00:34.480
to install

15
00:34.480 --> 00:37.970
Grafana this can be used to graph metrics that type of thing but if you want to

16
00:37.970 --> 00:38.720
search for a

17
00:38.720 --> 00:43.000
particular function maybe you want to get some type of Rediserver or EngineX

18
00:43.000 --> 00:44.320
whatever it may be

19
00:44.320 --> 00:49.110
you can just search for a particular keyboard and have Ansible Galaxy go and

20
00:49.110 --> 00:50.400
find that for you.

21
00:50.400 --> 00:54.080
So if I just search say for example for EngineX check this out we have all of

22
00:54.080 --> 00:54.640
these roles that

23
00:54.640 --> 00:58.350
perform this particular action whether it's going to install it in Docker

24
00:58.350 --> 00:58.880
whether it's just going

25
00:58.880 --> 01:02.380
to install a regular EngineX website for that type of thing and as we can see
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

25
00:58.880 --> 01:02.380
to install a regular EngineX website for that type of thing and as we can see

26
01:02.380 --> 01:03.200
here we have a

27
01:03.200 --> 01:07.750
ton of pages available to us six to eight pages just for EngineX so what I will

28
01:07.750 --> 01:08.240
do is I will

29
01:08.240 --> 01:12.670
change the download count and this here is the one that I'm going to download

30
01:12.670 --> 01:13.440
as we can see here

31
01:13.440 --> 01:17.600
10 million downloads this is a very stable and popular role so if I just click

32
01:17.600 --> 01:18.480
on the role right

33
01:18.480 --> 01:21.750
here pretty much we can click on the documentation explains everything about

34
01:21.750 --> 01:22.640
what the role is going

35
01:22.640 --> 01:26.610
to do and if we just want to install it well we just simply copy this

36
01:26.610 --> 01:27.840
particular command

37
01:27.840 --> 01:32.360
okay so let's copy this to clipboard and if I just paste this in and hit enter
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

37
01:27.840 --> 01:32.360
okay so let's copy this to clipboard and if I just paste this in and hit enter

38
01:32.360 --> 01:32.880
as we can see

39
01:32.880 --> 01:36.880
here we have successfully installed the Gailing Guy EngineX role so check this

40
01:36.880 --> 01:37.680
out if I say for

41
01:37.680 --> 01:41.710
example go to my managed devices right now so here is my yellow box if I say

42
01:41.710 --> 01:43.760
systemctl status on

43
01:43.760 --> 01:48.410
EngineX notice we actually do not have an EngineX server on this device and if

44
01:48.410 --> 01:49.200
we go to the blue

45
01:49.200 --> 01:53.190
box systemctl status engineX once again we can see we do not have this

46
01:53.190 --> 01:54.960
particular service let me

47
01:54.960 --> 01:59.230
create a play called role test dot yml okay and let's go into this particular

48
01:59.230 --> 02:00.480
file with them
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

48
01:59.230 --> 02:00.480
file with them

49
02:00.480 --> 02:03.920
have my three hyphens at the top all I will do is I'll give this a name and I

50
02:03.920 --> 02:05.280
'll just say install

51
02:05.280 --> 02:10.720
EngineX on real servers the host I'm going to target will be my all group and

52
02:10.720 --> 02:11.360
all I will do is

53
02:11.360 --> 02:15.180
I'll specify the roles keyword have my hyphen and then give the name of the

54
02:15.180 --> 02:16.400
role that I just installed

55
02:16.400 --> 02:21.790
which in this case here was Gailing Guy dot EngineX this is all I need to do

56
02:21.790 --> 02:22.560
and if I want to build

57
02:22.560 --> 02:26.030
upon this I can go and add my own custom task but as we can see here this is

58
02:26.030 --> 02:27.440
actually not necessary

59
02:27.440 --> 02:32.160
so right now if I just press escape colon wq to write and quits if I just say
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

59
02:27.440 --> 02:32.160
so right now if I just press escape colon wq to write and quits if I just say

60
02:32.160 --> 02:33.360
answerable playbook

61
02:33.360 --> 02:37.340
on role test and to enter check this out right here answerable begins config

62
02:37.340 --> 02:38.560
uring the EngineX

63
02:38.560 --> 02:42.610
service on all of our devices see we can see that running through all the tasks

64
02:42.610 --> 02:43.440
and as we can see

65
02:43.440 --> 02:47.690
here everything is okay we have five changes on the device or rather five

66
02:47.690 --> 02:49.280
changes on each device

67
02:49.280 --> 02:52.910
so if I go back to the yellow box hit the up arrow check for the status of

68
02:52.910 --> 02:54.320
EngineX notice now we

69
02:54.320 --> 02:58.990
actually have an active and running EngineX web server similarly on the blue

70
02:58.990 --> 03:00.000
box let's go here
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

71
03:00.000 --> 03:04.220
arrow up check the status inside of this particular machine we also have the

72
03:04.220 --> 03:06.000
same EngineX web server

73
03:06.000 --> 03:08.790
now do you see how simple this was to get set up we have the power of

74
03:08.790 --> 03:10.240
automation we could potentially

75
03:10.240 --> 03:13.360
be connecting to a hundred of devices and to get all of these devices

76
03:13.360 --> 03:14.960
configured with a web server

77
03:14.960 --> 03:18.770
we just installed a role and just referenced the role in one line within a

78
03:18.770 --> 03:20.000
playbook this shows us

79
03:20.000 --> 03:24.550
the power and simplicity of the answerable role so we can go directly to answer

80
03:24.550 --> 03:25.920
able galaxy however

81
03:25.920 --> 03:30.700
another thing we can do is actually install system roles for Red Hat Enterprise
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

81
03:25.920 --> 03:30.700
another thing we can do is actually install system roles for Red Hat Enterprise

82
03:30.700 --> 03:31.440
Linux these are

83
03:31.440 --> 03:35.820
actively being developed and maintained for the Red Hat Enterprise Linux system

84
03:35.820 --> 03:36.320
so let's go back

85
03:36.320 --> 03:41.450
to our control mode if I just clear the screen all I'm going to do is say sudo

86
03:41.450 --> 03:43.040
dnf install rel

87
03:43.040 --> 03:48.480
hyphen system hyphen roles and to enter if I just hit y and to enter again it's

88
03:48.480 --> 03:49.120
going to begin

89
03:49.120 --> 03:53.120
installing these system roles perfect now once you've done this if you go into

90
03:53.120 --> 03:55.040
user share docs

91
03:55.040 --> 03:59.370
and then rel system role if I do an LSP have all of these particular

92
03:59.370 --> 04:00.880
directories and inside of
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

92
03:59.370 --> 04:00.880
directories and inside of

93
04:00.880 --> 04:04.890
these directories are these system roles for particular services things like

94
04:04.890 --> 04:06.480
say for example a post

95
04:06.480 --> 04:10.010
gracio server or perhaps you want to set up some type of seelanitz

96
04:10.010 --> 04:11.840
configuration these roles are

97
04:11.840 --> 04:15.410
all within these particular folders so in this case here let's go into say for

98
04:15.410 --> 04:16.240
example the time

99
04:16.240 --> 04:19.700
sync folder okay check this out right here we actually have these example play

100
04:19.700 --> 04:20.400
books so we have

101
04:20.400 --> 04:25.250
an example single pull playbook for a single ntp server and we also have a

102
04:25.250 --> 04:26.720
playbook for multiple

103
04:26.720 --> 04:30.910
ntp servers so if I just go into the single pull for example here check this
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

103
04:26.720 --> 04:30.910
ntp servers so if I just go into the single pull for example here check this

104
04:30.910 --> 04:32.320
out right here this

105
04:32.320 --> 04:36.390
is an example playbook so what I'm going to do here is just go out temporarily

106
04:36.390 --> 04:37.200
and all I'm going

107
04:37.200 --> 04:41.580
to do is I'm going to copy the example single pull playbook from within this

108
04:41.580 --> 04:42.480
directory and I'm

109
04:42.480 --> 04:47.210
just going to copy it to my home directory using the tilde sign if I hit enter

110
04:47.210 --> 04:48.080
do cd go back to

111
04:48.080 --> 04:52.790
my home directory here doing ls now I have a copy of the example single pull

112
04:52.790 --> 04:54.080
playbook so let's use

113
04:54.080 --> 04:57.700
them to edit this all I'm going to do is I'm going to change the targets in

114
04:57.700 --> 04:58.560
this case here

115
04:58.560 --> 05:01.720
I'm going to target the all group and if I want to make some quick
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

115
04:58.560 --> 05:01.720
I'm going to target the all group and if I want to make some quick

116
05:01.720 --> 05:02.800
modifications of the

117
05:02.800 --> 05:06.140
particular configurations then I have the ability to do that but right now I

118
05:06.140 --> 05:07.120
will just save my

119
05:07.120 --> 05:11.080
changes and all I will now do is say answerable playbook example single pull

120
05:11.080 --> 05:12.720
playbook dot yml if I

121
05:12.720 --> 05:16.680
enter answer will begin walking through all of the configuration necessary to

122
05:16.680 --> 05:17.520
get the server up

123
05:17.520 --> 05:21.260
and running and as we can see here we have a sifting task with four changes 24

124
05:21.260 --> 05:22.480
have been skipped

125
05:22.480 --> 05:25.760
and we have nothing failed so look at all the things that were actually done

126
05:25.760 --> 05:27.360
enabling cronyd

127
05:27.360 --> 05:32.240
restarting cronyd updating the network sis config file all of that was handled
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

127
05:27.360 --> 05:32.240
restarting cronyd updating the network sis config file all of that was handled

128
05:32.240 --> 05:33.200
automatically for

129
05:33.200 --> 05:37.120
you simply by virtue of using the answerable role so now we've seen how to

130
05:37.120 --> 05:38.000
create our own

131
05:38.000 --> 05:40.950
roles as well as how to consume the roles created by other members of the

132
05:40.950 --> 05:42.320
answerable community

133
05:42.320 --> 05:44.960
let's now validate what we've learned within this skill
