WEBVTT

1
00:00.000 --> 00:03.950
So friends in the previous video we learned how we could utilize the service

2
00:03.950 --> 00:05.200
module with an answerable.

3
00:05.200 --> 00:09.200
And now I want to turn your attention to as the management of boot targets on

4
00:09.200 --> 00:09.840
the system.

5
00:09.840 --> 00:14.640
So recall when you studied for your RH CSA examination, you will have learned

6
00:14.640 --> 00:15.600
about this concept of

7
00:15.600 --> 00:19.060
boot targets which is basically controlling the environment and which your

8
00:19.060 --> 00:20.160
system happens to boot.

9
00:20.160 --> 00:24.890
So say for example in my case here I have a graphical environment and that's

10
00:24.890 --> 00:26.240
because I'm using the

11
00:26.240 --> 00:30.540
graphical dot target boot target whereas if my system is perhaps maybe
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

11
00:26.240 --> 00:30.540
graphical dot target boot target whereas if my system is perhaps maybe

12
00:30.540 --> 00:32.160
compromised or damaged I

13
00:32.160 --> 00:37.030
may want to load into a more limited environment known as the rescue targets or

14
00:37.030 --> 00:37.680
maybe I didn't want

15
00:37.680 --> 00:41.450
to have a graphical user interface I just wanted my regular command line with

16
00:41.450 --> 00:42.560
all my services available

17
00:42.560 --> 00:47.240
to me I could have the multi user dot target configured. This is a type of

18
00:47.240 --> 00:47.920
thing we're going

19
00:47.920 --> 00:51.600
to learn how to manage at scale with answerable. So if you're on the command

20
00:51.600 --> 00:52.960
systems UTL get

21
00:52.960 --> 00:57.120
default what this actually shows me is the default target that will be booted

22
00:57.120 --> 00:58.160
into when the system

23
00:58.160 --> 01:01.900
restarts. Now right now as we can see my environment is configured to be a
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

23
00:58.160 --> 01:01.900
restarts. Now right now as we can see my environment is configured to be a

24
01:01.900 --> 01:03.200
graphical target and the

25
01:03.200 --> 01:07.380
same thing is true right now on both of my managed devices the yellow box and

26
01:07.380 --> 01:08.720
the blue box. If however

27
01:08.720 --> 01:13.520
I wanted to change the targets but what I could do would be to run the command

28
01:13.520 --> 01:14.880
system CTL set

29
01:14.880 --> 01:18.200
default and then define whatever default target you want to be. So say for

30
01:18.200 --> 01:18.960
example like I say

31
01:18.960 --> 01:22.760
graphical dot targets I could type in my passwords and that would define the

32
01:22.760 --> 01:23.840
target. Now of course I'd

33
01:23.840 --> 01:27.290
then actually change anything quite just there. So if I wanted to change the

34
01:27.290 --> 01:28.160
target I could say

35
01:28.160 --> 01:33.520
pseudo system CTL set hyphen default and then specify a new boot target such as
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

35
01:28.160 --> 01:33.520
pseudo system CTL set hyphen default and then specify a new boot target such as

36
01:33.520 --> 01:34.080
maybe say

37
01:34.080 --> 01:37.930
multi user dot target. Now when I hit enter notice my graphical environment

38
01:37.930 --> 01:39.200
doesn't actually go away

39
01:39.200 --> 01:43.470
for this to actually take effect I would have to reboot the system and as we

40
01:43.470 --> 01:44.560
can see I also have

41
01:44.560 --> 01:49.190
another user logged on so I'll just say pseudo system CTL or reboots - I to

42
01:49.190 --> 01:50.240
ignore and when it

43
01:50.240 --> 01:54.950
reboots now the changes have taken effect and as we can see here I no longer

44
01:54.950 --> 01:56.000
have a graphical

45
01:56.000 --> 02:00.240
environment and if I happen to log in here there's log in as Ansible with the
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

45
01:56.000 --> 02:00.240
environment and if I happen to log in here there's log in as Ansible with the

46
02:00.240 --> 02:01.600
password Ansible and

47
02:01.600 --> 02:06.280
I say system CTL get default now we can see the default has been changed to

48
02:06.280 --> 02:07.440
multi user dot targets

49
02:07.440 --> 02:11.650
all I will do right now as I'm going to switch back to my graphical environment

50
02:11.650 --> 02:12.400
so I'll set the

51
02:12.400 --> 02:15.850
default to graphical dot target and reboot the system open of course I'm going

52
02:15.850 --> 02:16.400
to have to say

53
02:16.400 --> 02:20.640
system CTL and I know reboots and as we can see we're back now one thing to

54
02:20.640 --> 02:21.600
note here is that when

55
02:21.600 --> 02:26.800
we happen to be managing our boot targets we actually do not have a dedicated

56
02:26.800 --> 02:28.000
boot target module

57
02:28.000 --> 02:32.260
instead we're just going to use the built-in command module now the important
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

57
02:28.000 --> 02:32.260
instead we're just going to use the built-in command module now the important

58
02:32.260 --> 02:33.040
thing to note

59
02:33.040 --> 02:37.880
about the command module is that it's not going to act in an item portant

60
02:37.880 --> 02:39.360
manner now this is a very

61
02:39.360 --> 02:43.750
very important concept within the world of automation and in Ansible so let me

62
02:43.750 --> 02:44.720
explain to you what it

63
02:44.720 --> 02:48.240
means to have an item portant playbook so let's imagine we have our Ansible

64
02:48.240 --> 02:49.120
control node here

65
02:49.120 --> 02:55.070
and our blue box machine over here as well as our yellow box now let's say on

66
02:55.070 --> 02:56.480
these two devices

67
02:56.480 --> 03:01.290
we want to install a post-grace dual server okay now the service itself doesn't
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

67
02:56.480 --> 03:01.290
we want to install a post-grace dual server okay now the service itself doesn't

68
03:01.290 --> 03:02.000
actually matter

69
03:02.000 --> 03:06.340
I'm just using post-grace as an example here now right now if you imagine as it

70
03:06.340 --> 03:07.520
stands post-grace

71
03:07.520 --> 03:12.170
dual is not installed on this server here or here yet so what we do is we write

72
03:12.170 --> 03:13.360
an Ansible playbook

73
03:13.360 --> 03:18.110
to use dnf to actually install post-grace dual on both of these devices okay so

74
03:18.110 --> 03:18.800
effectively the

75
03:18.800 --> 03:23.210
playbook goes and attempts to install post-grace dual on both devices so now it

76
03:23.210 --> 03:24.240
is present now the

77
03:24.240 --> 03:29.390
dnf module within Ansible is an item portant module so what that means is that

78
03:29.390 --> 03:30.560
if we happen to
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

78
03:29.390 --> 03:30.560
if we happen to

79
03:30.560 --> 03:35.540
re-run the exact same playbook when Ansible begins to run it actually checks

80
03:35.540 --> 03:37.120
hey do I actually need

81
03:37.120 --> 03:41.170
to perform this task meaning that Ansible has a type of awareness about what it

82
03:41.170 --> 03:41.920
's actually trying

83
03:41.920 --> 03:46.090
to perform do I really have to go through the process of installing it and in

84
03:46.090 --> 03:47.040
the case of these

85
03:47.040 --> 03:51.020
two devices now because it was already installed in the previous run of the

86
03:51.020 --> 03:52.240
playbook now Ansible

87
03:52.240 --> 03:55.990
detects that it's already present and it doesn't actually have to do it again

88
03:55.990 --> 03:56.880
so effectively as

89
03:56.880 --> 04:01.060
opposed to trying to do the exact same task all over again Ansible notices that
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

89
03:56.880 --> 04:01.060
opposed to trying to do the exact same task all over again Ansible notices that

90
04:01.060 --> 04:02.160
post-grace is on

91
04:02.160 --> 04:06.400
this machine here and just skips a task entirely and the same thing is true on

92
04:06.400 --> 04:07.520
the yellow box and

93
04:07.520 --> 04:11.720
for every time we run the playbook again and again and again so long as no

94
04:11.720 --> 04:12.960
changes are needed

95
04:12.960 --> 04:17.320
Ansible will not attempt to make any changes it's just going to skip over them

96
04:17.320 --> 04:17.920
so to call from the

97
04:17.920 --> 04:22.920
previous video we happened to have the service example module and we installed

98
04:22.920 --> 04:23.600
a htpd now all

99
04:23.600 --> 04:26.970
I'll do here is I'll copy this over here and I'll just call this item portant

100
04:26.970 --> 04:28.480
example dot ymlk

101
04:28.480 --> 04:31.600
and all I'll do here is just delete this part because all I want to focus in on
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

101
04:28.480 --> 04:31.600
and all I'll do here is just delete this part because all I want to focus in on

102
04:31.600 --> 04:32.320
is this part

103
04:32.320 --> 04:37.590
right here now remember htpd is already installed on both of my target devices

104
04:37.590 --> 04:38.320
so check this out

105
04:38.320 --> 04:43.140
when I run the playbook and the hit answer notice nothing was actually changed

106
04:43.140 --> 04:44.000
Ansible didn't seek

107
04:44.000 --> 04:47.310
to make any changes at all and that is one of the reasons why the playbook is

108
04:47.310 --> 04:48.160
running so fast it's

109
04:48.160 --> 04:51.970
not actually having to go through the installation all over again now like I

110
04:51.970 --> 04:53.200
say the issue with the

111
04:53.200 --> 04:56.700
command module is that it's always going to detect the change therefore it's

112
04:56.700 --> 04:57.680
not going to have the

113
04:57.680 --> 05:01.250
intelligence of an item portant module so what we're going to do here is we're
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

113
04:57.680 --> 05:01.250
intelligence of an item portant module so what we're going to do here is we're

114
05:01.250 --> 05:02.320
going to manually

115
05:02.320 --> 05:07.270
build out the logic so that the module does act in an item portant way meaning

116
05:07.270 --> 05:08.160
that it's only

117
05:08.160 --> 05:11.880
going to perform certain actions if they are required now what action am I

118
05:11.880 --> 05:12.880
talking about when

119
05:12.880 --> 05:16.420
I'm talking about the actual rebooting of a server because remember when we

120
05:16.420 --> 05:17.600
happen to make a change

121
05:17.600 --> 05:22.200
to a boot target it doesn't actually take effect until we reboot the system and

122
05:22.200 --> 05:23.040
we only want to

123
05:23.040 --> 05:27.250
reboot a system when a change has been made so let's go and see how we can

124
05:27.250 --> 05:28.640
actually do this then

125
05:28.640 --> 05:31.860
so what I will do here is I'll create a playbook and let's just call this boot
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

125
05:28.640 --> 05:31.860
so what I will do here is I'll create a playbook and let's just call this boot

126
05:31.860 --> 05:33.200
target example

127
05:33.200 --> 05:38.200
dot yml go into insert mode have our three hyphens and we'll just say play to

128
05:38.200 --> 05:39.200
test boot target

129
05:39.200 --> 05:42.610
management the host we're going to target is going to be the all group and once

130
05:42.610 --> 05:43.200
again we're going

131
05:43.200 --> 05:46.800
to set gather facts to false and the very first thing that I'm going to do here

132
05:46.800 --> 05:47.680
is I'm going to

133
05:47.680 --> 05:52.030
define my variable which is going to be the default target now my default

134
05:52.030 --> 05:52.960
target I'm going to

135
05:52.960 --> 05:57.190
specify as graphical target right now now what I want to do is I want to define

136
05:57.190 --> 05:58.320
my tasks and I'll

137
05:58.320 --> 06:02.750
just say retrieve the default target now like I said we don't have an actual
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

137
05:58.320 --> 06:02.750
just say retrieve the default target now like I said we don't have an actual

138
06:02.750 --> 06:04.000
boot target module

139
06:04.000 --> 06:08.130
so we're just going to say ansbo dot built-in dot command and we're going to

140
06:08.130 --> 06:09.120
use the command

141
06:09.120 --> 06:12.790
parameter so what command are we actually going to run well as we saw we can

142
06:12.790 --> 06:13.520
get the default

143
06:13.520 --> 06:18.780
configuration by saying systemctl get hyphen default now what I'm going to do

144
06:18.780 --> 06:19.840
right here is I'm

145
06:19.840 --> 06:24.180
going to have the keyword register because I want to capture the outputs or say

146
06:24.180 --> 06:25.360
default outputs

147
06:25.360 --> 06:28.530
and I'll just have a new task saying print the outputs and all I'm going to do

148
06:28.530 --> 06:29.440
is use a debug

149
06:29.440 --> 06:33.200
module with the var parameter and I'm going to print out that default
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

149
06:29.440 --> 06:33.200
module with the var parameter and I'm going to print out that default

150
06:33.200 --> 06:34.960
underscore output variable

151
06:34.960 --> 06:40.020
so check this out right now if I say ansible playbook but target example and to

152
06:40.020 --> 06:40.960
enter as we can

153
06:40.960 --> 06:44.790
see here we run the command and we get our output to now notice here it says a

154
06:44.790 --> 06:46.480
change has been applied

155
06:46.480 --> 06:50.680
this is always going to happen when we run the command module again I could re

156
06:50.680 --> 06:51.280
run the exact

157
06:51.280 --> 06:55.840
same playbook hit enter and watch this it still says changed so we can't rely

158
06:55.840 --> 06:57.360
on this module alone

159
06:57.360 --> 07:01.750
to detect whether a change actually happened on the system now let me just
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

159
06:57.360 --> 07:01.750
to detect whether a change actually happened on the system now let me just

160
07:01.750 --> 07:02.560
scroll on up a little

161
07:02.560 --> 07:06.640
bit what I want to do here is to get the actual response from that command and

162
07:06.640 --> 07:07.440
we can see that

163
07:07.440 --> 07:11.940
is contained within the STD out key so if I go back to my playbook here and I

164
07:11.940 --> 07:13.280
go into insert mode

165
07:13.280 --> 07:18.800
and I say dot STD out if I rerun playbook now we're just getting the response

166
07:18.800 --> 07:19.360
from the command

167
07:19.360 --> 07:24.010
itself graphical dot target now like I say we're always still getting this

168
07:24.010 --> 07:25.440
changed okay now I'm

169
07:25.440 --> 07:28.590
going to modify this I don't want that to automatically happen so what I'm

170
07:28.590 --> 07:30.480
going to do here is when I
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

170
07:28.590 --> 07:30.480
going to do here is when I

171
07:30.480 --> 07:35.360
run the command module and I specify the command I'm going to say changed

172
07:35.360 --> 07:36.720
underscore when and I'm

173
07:36.720 --> 07:40.270
going to set it to the value false so watch this if I rerun the exact same

174
07:40.270 --> 07:41.360
playbook we're not just

175
07:41.360 --> 07:45.680
going to automatically say oh a change has happened instead we're going to run

176
07:45.680 --> 07:47.600
our own conditional logic

177
07:47.600 --> 07:53.430
to determine whether the value we get back from this particular key here is

178
07:53.430 --> 07:54.320
different from the

179
07:54.320 --> 07:58.400
default target that we have specified so check this out let's go back in and

180
07:58.400 --> 07:59.440
now I'll create a

181
07:59.440 --> 08:04.350
new task and I'll just say sets the default targets now once again we're going
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

181
07:59.440 --> 08:04.350
new task and I'll just say sets the default targets now once again we're going

182
08:04.350 --> 08:05.280
to have to use that

183
08:05.280 --> 08:10.090
Ansible built-in command module and the command I'm going to use here is going

184
08:10.090 --> 08:11.120
to be systemctl

185
08:11.120 --> 08:15.050
set hyphen default and I want to set the default target now I've got this

186
08:15.050 --> 08:16.560
variable here and that's

187
08:16.560 --> 08:20.310
what I'm going to call so I'll have my double curly braces and I'll just

188
08:20.310 --> 08:21.680
reference the default

189
08:21.680 --> 08:27.250
target variable like I say I don't just want to blindly run this command I only

190
08:27.250 --> 08:28.800
want to run it

191
08:28.800 --> 08:33.270
when there is a discrepancy between the value here to find it or default value
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

191
08:28.800 --> 08:33.270
when there is a discrepancy between the value here to find it or default value

192
08:33.270 --> 08:34.000
versus what we

193
08:34.000 --> 08:38.060
actually get from the output of the get default command so what I will do here

194
08:38.060 --> 08:39.120
is use my conditional

195
08:39.120 --> 08:43.180
logic via a when statement and I'm going to say when the default target

196
08:43.180 --> 08:45.360
variable is not in the

197
08:45.360 --> 08:50.220
actual output that we see right here so I'll say default on those code outputs

198
08:50.220 --> 08:51.280
dot std outs now

199
08:51.280 --> 08:54.060
right now there should be no discrepancy so let's run the playbook we're going

200
08:54.060 --> 08:54.960
to create the default

201
08:54.960 --> 08:59.110
targets and because the default target matches our current configuration we

202
08:59.110 --> 09:00.400
actually skip the task
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

202
08:59.110 --> 09:00.400
actually skip the task

203
09:00.400 --> 09:05.370
we don't attempt to try to change the target because it already is what we want

204
09:05.370 --> 09:06.160
it to be now

205
09:06.160 --> 09:10.480
let's briefly go back in so let's say we change it to the multi user dot target

206
09:10.480 --> 09:11.360
now the default

207
09:11.360 --> 09:15.490
target is going to be different from what we actually get back from this

208
09:15.490 --> 09:16.640
command therefore

209
09:16.640 --> 09:20.060
this conditional statement will be met and will actually seek to run this

210
09:20.060 --> 09:21.280
particular command as

211
09:21.280 --> 09:24.910
opposed to skipping this task so let's try it out add a what we run the

212
09:24.910 --> 09:26.400
playbook hit enter we pull

213
09:26.400 --> 09:30.640
the results run the comparison see a change and therefore because of the change
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

213
09:26.400 --> 09:30.640
the results run the comparison see a change and therefore because of the change

214
09:30.640 --> 09:31.440
we run that new

215
09:31.440 --> 09:35.600
command to set the default target to the new value now like I say if we go back

216
09:35.600 --> 09:37.200
to our devices if I

217
09:37.200 --> 09:40.530
look at the yellow box right here I still have my graphical environment that is

218
09:40.530 --> 09:41.520
because we didn't

219
09:41.520 --> 09:46.420
reboot the system so what we want to do is we want to invoke a handler which is

220
09:46.420 --> 09:48.000
going to run a task

221
09:48.000 --> 09:51.810
or when a change happens to be detected now for the rebooting of a server we

222
09:51.810 --> 09:53.040
actually do have a

223
09:53.040 --> 09:57.140
dedicated ansible module if you happen to search for ansible reboot module this

224
09:57.140 --> 09:57.680
is the one we're

225
09:57.680 --> 10:01.340
going to use and again this is a built-in module so we don't have to install
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

225
09:57.680 --> 10:01.340
going to use and again this is a built-in module so we don't have to install

226
10:01.340 --> 10:02.720
anything and notice if

227
10:02.720 --> 10:06.910
we scroll on down we have this particular parameter reboot timeout this is

228
10:06.910 --> 10:08.000
pretty much where we can

229
10:08.000 --> 10:12.540
specify some time to wait to give the server time to rebut now right now the

230
10:12.540 --> 10:13.760
default is 600

231
10:13.760 --> 10:17.390
seconds in the interest of speed for this demo I will set the value to a little

232
10:17.390 --> 10:18.320
bit lower maybe

233
10:18.320 --> 10:22.150
one minute for example so let's go and check this out then let's go back to our

234
10:22.150 --> 10:23.360
playbook and in order

235
10:23.360 --> 10:27.490
to invoke a handler I'm going to have my notify here and let's just call this

236
10:27.490 --> 10:28.960
reboot system so now I

237
10:28.960 --> 10:32.700
have to define the handler so at the same level of indentation as my tasks I
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

237
10:28.960 --> 10:32.700
have to define the handler so at the same level of indentation as my tasks I

238
10:32.700 --> 10:34.000
will specify my handler

239
10:34.000 --> 10:37.720
here and I'll give it a name and I'll just match up with the name of the notify

240
10:37.720 --> 10:38.560
keyword which is

241
10:38.560 --> 10:43.180
going to be reboot system and now I'll just use the ansible built-in reboot

242
10:43.180 --> 10:44.160
module and I'm going

243
10:44.160 --> 10:48.160
to specify that the reboot timeout in my case here it's going to be 60 second

244
10:48.160 --> 10:48.960
now remember the

245
10:48.960 --> 10:53.140
handler is only ever going to run when a change happens to be detected so

246
10:53.140 --> 10:54.480
basically if we have to

247
10:54.480 --> 10:59.470
run this particular command that will invoke a change on the system and that

248
10:59.470 --> 11:00.880
will call the handler
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

248
10:59.470 --> 11:00.880
will call the handler

249
11:00.880 --> 11:05.450
so right now if I go to my devices here go to my terminal if I just say system

250
11:05.450 --> 11:07.040
ctl get default

251
11:07.040 --> 11:10.660
we can see we're at multi-user.target even though it's not taking effect yet

252
11:10.660 --> 11:11.600
just for the demo here

253
11:11.600 --> 11:16.220
what I'm going to do is I'm going to change it back to be graphical.target so

254
11:16.220 --> 11:17.120
now if I do get

255
11:17.120 --> 11:22.020
default it's graphical I'll do the same on the blue box pseudo systemctl set

256
11:22.020 --> 11:23.600
default graphical

257
11:23.600 --> 11:28.020
dot targets so when I go to run this playbook the actual default value within

258
11:28.020 --> 11:29.280
the playbook is going

259
11:29.280 --> 11:33.870
to be multi-user.target which will be different from the result of the get
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

259
11:29.280 --> 11:33.870
to be multi-user.target which will be different from the result of the get

260
11:33.870 --> 11:35.120
default command now

261
11:35.120 --> 11:38.280
because that has now been reconfigured to be graphical because of the

262
11:38.280 --> 11:39.840
discrepancy we will once again

263
11:39.840 --> 11:44.050
run this command to set the default target and that will call the handler to in

264
11:44.050 --> 11:44.400
fact

265
11:44.400 --> 11:48.510
reboot the system to make the changes take effect so let's try this out then

266
11:48.510 --> 11:48.880
obviously

267
11:48.880 --> 11:53.210
answer my playbook book target example that yml and to answer oh and I've got a

268
11:53.210 --> 11:53.760
little bit of a

269
11:53.760 --> 11:57.750
syntax error let me just go and fix the indentation here just move that in a

270
11:57.750 --> 11:59.200
space there we go let's

271
11:59.200 --> 12:02.980
try again now the playbook runs as we can see the graphical target is different
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

271
11:59.200 --> 12:02.980
try again now the playbook runs as we can see the graphical target is different

272
12:02.980 --> 12:03.840
from the multi-user

273
12:03.840 --> 12:07.440
target we set therefore we have a change on the system being invoked and now we

274
12:07.440 --> 12:08.240
're calling the

275
12:08.240 --> 12:12.650
handler to reboot the system we shall now wait 60 seconds to give the server

276
12:12.650 --> 12:13.520
time to reboots

277
12:13.520 --> 12:17.040
so you'll notice on the yellow box the system is indeed rebooting and as we can

278
12:17.040 --> 12:17.440
see on the

279
12:17.440 --> 12:21.800
yellow box we now have this multi-user environment the same thing will be true

280
12:21.800 --> 12:22.480
over on the blue

281
12:22.480 --> 12:25.720
box so let's check that too same thing is true here and if we look at the

282
12:25.720 --> 12:26.960
result of the playbook

283
12:26.960 --> 12:31.600
we get our play recap now if I run the same playbook again because there should
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

283
12:26.960 --> 12:31.600
we get our play recap now if I run the same playbook again because there should

284
12:31.600 --> 12:32.480
be no changes

285
12:32.480 --> 12:36.590
let's hit enter check this out right here immediately we print it the output we

286
12:36.590 --> 12:37.520
see it's multi-user

287
12:37.520 --> 12:42.070
dot target that is no difference therefore we don't seek to change the default

288
12:42.070 --> 12:42.560
target

289
12:42.560 --> 12:46.880
and therefore the handler does not run we don't seek to reboot the system and

290
12:46.880 --> 12:47.360
again they could

291
12:47.360 --> 12:50.860
just keep hitting enter and enter and it's not going to change it's always

292
12:50.860 --> 12:51.840
going to skip because

293
12:51.840 --> 12:55.810
we now have that built-in intelligence to make the playbook item potent and

294
12:55.810 --> 12:56.960
once again if we just

295
12:56.960 --> 13:00.650
make a change let's go back up to the playbook we'll change the default target
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

295
12:56.960 --> 13:00.650
make a change let's go back up to the playbook we'll change the default target

296
13:00.650 --> 13:01.600
to specify that it

297
13:01.600 --> 13:05.390
should be indeed the graphical user interface once again because we have made

298
13:05.390 --> 13:06.080
this change

299
13:06.080 --> 13:09.840
answerable will detect the change and because of that the system will be reboot

300
13:09.840 --> 13:10.720
ed to implement

301
13:10.720 --> 13:14.960
that change so we just give this a minute to complete now the play because done

302
13:14.960 --> 13:19.100
ethical back to our devices over on the yellow box we have our login screen for

303
13:19.100 --> 13:19.600
our graphical

304
13:19.600 --> 13:23.120
environment and the same thing is true on the blue box
