WEBVTT

1
00:00.000 --> 00:03.960
So previously we learned about the different organizations we can create as

2
00:03.960 --> 00:06.600
well as how we can create different users and teams.

3
00:06.600 --> 00:10.060
Now what I want to do is to turn your attention to the actual devices that we

4
00:10.060 --> 00:11.300
're going to be managing.

5
00:11.300 --> 00:16.060
So how do we detail which devices we want to manage, but we can do this via our

6
00:16.060 --> 00:16.800
inventory.

7
00:16.800 --> 00:19.100
The same may be Auto-Nallywood with Ansible.

8
00:19.100 --> 00:22.880
So within our inventory we can list all of the devices we manage as well as

9
00:22.880 --> 00:25.700
subdivide them into different logical groupings.

10
00:25.700 --> 00:29.360
Same thing is true here, similarly we also have to think about how do we

11
00:29.360 --> 00:32.600
actually authenticate with the devices that we happen to be managing,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

11
00:29.360 --> 00:32.600
actually authenticate with the devices that we happen to be managing,

12
00:32.600 --> 00:36.940
how do we log into them, well that is going to be specified via particular

13
00:36.940 --> 00:38.000
credentials.

14
00:38.000 --> 00:41.400
So let's go and see how this actually operates then.

15
00:41.400 --> 00:44.300
So let's start by first creating an inventory.

16
00:44.300 --> 00:47.950
Now just before we begin to keep things really quite simple, all I will do is I

17
00:47.950 --> 00:49.900
'll log out of my John McG account

18
00:49.900 --> 00:53.640
and I'll just log in as the regular admin with the username admin and the

19
00:53.640 --> 00:55.000
password of password 1.

20
00:55.000 --> 00:59.420
So what I will do here is I will go to my inventory and as we can see we have a

21
00:59.420 --> 01:00.400
demo inventory.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

21
00:59.420 --> 01:00.400
demo inventory.

22
01:00.400 --> 01:01.900
Let's create one for ourselves.

23
01:01.900 --> 01:05.720
So let's just add this here and we'll say add inventory and now I'll give this

24
01:05.720 --> 01:06.700
inventory a name.

25
01:06.700 --> 01:10.360
So let's just call this inventory Linux inventory because it's going to be an

26
01:10.360 --> 01:13.700
inventory of the Linux devices that we happen to be managing

27
01:13.700 --> 01:19.700
and the description can be inventory for red hat enterprise Linux devices.

28
01:19.700 --> 01:21.100
What is the organization?

29
01:21.100 --> 01:22.400
Well we know we created one.

30
01:22.400 --> 01:26.340
So let's collect this little magnifying glass and I will just select nugget

31
01:26.340 --> 01:28.100
tick and then choose select.

32
01:28.100 --> 01:32.100
Now all I will do here is scroll down and choose save kill.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

32
01:28.100 --> 01:32.100
Now all I will do here is scroll down and choose save kill.

33
01:32.100 --> 01:36.300
So we actually have created this inventory but as we know right now we actually

34
01:36.300 --> 01:39.500
haven't specified any groups or any hosts.

35
01:39.500 --> 01:42.900
Now we can actually see we do have these different tabs for such a thing.

36
01:42.900 --> 01:46.100
So what I will do first is I will go and specify my hosts.

37
01:46.100 --> 01:49.300
So let's go into hosts and I'll just choose add.

38
01:49.300 --> 01:52.300
Now the name of the host here is going to be blue box.

39
01:52.300 --> 01:56.240
And description can just be the blue box rail machine or real device whatever

40
01:56.240 --> 01:56.800
it may be.

41
01:56.800 --> 02:00.560
Now important point to note remember in regular answerable for each device we
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

41
01:56.800 --> 02:00.560
Now important point to note remember in regular answerable for each device we

42
02:00.560 --> 02:02.900
can have this host vars directory.

43
02:02.900 --> 02:07.030
And inside of that directory we're going to have a pair host yaml file for

44
02:07.030 --> 02:11.600
every single host and we can define those variables according to that host.

45
02:11.600 --> 02:15.870
In the case here we can also define these host variables for that particular

46
02:15.870 --> 02:16.600
device.

47
02:16.600 --> 02:20.830
Okay, so say for example the blue box happened to have a particular or let's

48
02:20.830 --> 02:22.400
maybe say variable calls.

49
02:22.400 --> 02:25.850
I don't know what to say custom message okay doesn't actually matter and I just

50
02:25.850 --> 02:28.700
say greetings from the blue box.

51
02:28.700 --> 02:32.640
We can just simply define these variables as we are the marleu woods and again
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

51
02:28.700 --> 02:32.640
We can just simply define these variables as we are the marleu woods and again

52
02:32.640 --> 02:36.360
of course if you want to leave this blank then you are absolutely free to do so

53
02:36.360 --> 02:36.600
.

54
02:36.600 --> 02:39.700
So all I will do right now with that created I will choose save.

55
02:39.700 --> 02:44.270
So now we have created the blue box we see the description and what I can do is

56
02:44.270 --> 02:46.400
go back to my hosts and I'll just simply

57
02:46.400 --> 02:50.700
add another one so I'll add this here and I'll just say the yellow box and the

58
02:50.700 --> 02:52.900
description is the yellow box rail device.

59
02:52.900 --> 02:56.820
Now of course we can add in more host variables but in my case here I'm just

60
02:56.820 --> 03:00.200
going to leave this blank so I'll just go down and click save.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

60
02:56.820 --> 03:00.200
going to leave this blank so I'll just go down and click save.

61
03:00.200 --> 03:04.440
And now again if you go back to your host we can see here within this inventory

62
03:04.440 --> 03:08.900
the Linux inventory we have two devices blue box and yellow box.

63
03:08.900 --> 03:13.100
Now recall the automation platform right here is running on my control node so

64
03:13.100 --> 03:17.680
we actually do have resolutions or name resolutions for these particular names

65
03:17.680 --> 03:22.430
okay so blue box does actually correspond to a particular IP address as those

66
03:22.430 --> 03:26.530
yellow box in fact if I just minimized this here and I just go into it say

67
03:26.530 --> 03:26.900
hosts.

68
03:26.900 --> 03:30.880
We can see here we actually do have these mapping so the device itself or
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

68
03:26.900 --> 03:30.880
We can see here we actually do have these mapping so the device itself or

69
03:30.880 --> 03:35.460
rather the answerable automation platform has access to this name and its

70
03:35.460 --> 03:38.700
subsequent resolution so well know how to connect to the device for you.

71
03:38.700 --> 03:43.680
Yes I paid this okay now what I will do here is if I go and create a group and

72
03:43.680 --> 03:48.710
I just select ads now I can just create a regular group so let's maybe say I

73
03:48.710 --> 03:54.690
have a group called USA okay I can just say devices that are in the USA and

74
03:54.690 --> 03:59.700
again I can add in some group variable values for the USA group such as I don't

75
03:59.700 --> 04:04.100
know let's go with NTP server is one two three four doesn't actually matter and
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

75
03:59.700 --> 04:04.100
know let's go with NTP server is one two three four doesn't actually matter and

76
04:04.100 --> 04:07.700
also let's maybe go and add in a custom message as well and just say.

77
04:07.700 --> 04:12.380
There I am in the USA group cause let's go and save these so maybe happen to

78
04:12.380 --> 04:17.010
have a USA group as well as some group vars for that particular group but right

79
04:17.010 --> 04:21.810
now if we happen to look at the host that belong to this particular group we

80
04:21.810 --> 04:25.850
don't actually have any hosts within that group so this is kind of like if I

81
04:25.850 --> 04:29.700
just go back and show you my regular answerable inventory let's go back here.

82
04:29.700 --> 04:46.640
Let me just substitute to the answerable user if I don't if I go into the
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

82
04:29.700 --> 04:46.640
Let me just substitute to the answerable user if I don't if I go into the

83
04:46.640 --> 04:49.660
inventory I and I form this is effectively what I'm doing I've created the USA

84
04:49.660 --> 04:49.660
group just in the same way I did in my answerable I and I file and what I want

85
04:49.660 --> 04:49.660
to do is I want to now add the yellow box to that particular group so inside of

86
04:49.660 --> 04:51.860
the USA group we want to add in the yellow box so all I will do is choose add

87
04:51.860 --> 04:56.000
and I can choose to add an existing host I a host I have defined within my

88
04:56.000 --> 04:57.700
automation platform so let's click this here

89
04:57.700 --> 05:02.150
and all I will do is click yellow box and then choose save and now the yellow
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

89
04:57.700 --> 05:02.150
and all I will do is click yellow box and then choose save and now the yellow

90
05:02.150 --> 05:06.440
box is a member of the USA group and that means that the yellow box is also

91
05:06.440 --> 05:11.780
going to have access to those group variables within the USA group so again we

92
05:11.780 --> 05:15.230
click on the details we can see the yellow box would get this custom message

93
05:15.230 --> 05:18.700
unless it has a more specific variable within its host vars.

94
05:18.700 --> 05:23.000
Basically this is just operating the same way a regular answerable would. Coats

95
05:23.000 --> 05:26.240
like I say we now have our Linux inventory we have our two hosts we can see the

96
05:26.240 --> 05:29.530
two hosts are right here and we can see the groups that we have defined right

97
05:29.530 --> 05:34.190
now I have the USA group if I add another group and I just say UK just say UK
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

97
05:29.530 --> 05:34.190
now I have the USA group if I add another group and I just say UK just say UK

98
05:34.190 --> 05:35.700
for UK devices.

99
05:35.700 --> 05:39.200
Again you can add in whatever variables you want if you so wish but for now I

100
05:39.200 --> 05:42.700
will just choose save for simplicity and all I will do now is add in the host

101
05:42.700 --> 05:46.320
for that particular group now the group here or the host I'm going to add will

102
05:46.320 --> 05:51.700
be an existing host and this time I will put the blue box into the UK group so

103
05:51.700 --> 05:56.230
now blue box is a member of UK again getting access to any variables that you

104
05:56.230 --> 05:57.700
happen to define within that group.

105
05:57.700 --> 06:01.690
Now we want to be able to log in to our devices so all I will do now is go to
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

105
05:57.700 --> 06:01.690
Now we want to be able to log in to our devices so all I will do now is go to

106
06:01.690 --> 06:06.650
credentials and again we happen to have these automatically created credentials

107
06:06.650 --> 06:10.260
what I want to do is to define my own set I will choose add and I will give

108
06:10.260 --> 06:12.700
this a name so let's maybe just call this a real credentials

109
06:12.700 --> 06:17.730
I will just say log in details for my real devices what is the organization

110
06:17.730 --> 06:22.930
well if I choose the magnifying glass and choose nugget take once again that's

111
06:22.930 --> 06:26.880
for that organization and here is the credential type now depending on what you

112
06:26.880 --> 06:30.700
happen to be logging into you can have different credentials maybe you happen
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

112
06:26.880 --> 06:30.700
happen to be logging into you can have different credentials maybe you happen

113
06:30.700 --> 06:34.310
to need an API token maybe you want to supply some type of username and

114
06:34.310 --> 06:38.420
password whatever it may be pretty much you have support for that the one we

115
06:38.420 --> 06:41.700
want to be looking at is one known as machine just to log into a regular

116
06:41.700 --> 06:41.700
machine

117
06:41.700 --> 06:46.210
and that is going to allow to supply a username and password so when I want to

118
06:46.210 --> 06:50.730
log into these devices I would say Ansible or SSH Ansible and then give the

119
06:50.730 --> 06:55.090
name of the device such as yellow box if I enter I have actually configured

120
06:55.090 --> 06:59.550
passwordless authentication for Ansible the way I did this was by copying over

121
06:59.550 --> 07:00.700
my SSH keys
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

121
06:59.550 --> 07:00.700
my SSH keys

122
07:00.700 --> 07:05.540
now here is the thing on the Ansible automation platform what I actually can do

123
07:05.540 --> 07:10.280
is I can actually copy over these private keys if I so wish but because Ansible

124
07:10.280 --> 07:14.090
automation platform can affect it will just save these details we don't have to

125
07:14.090 --> 07:17.910
continually type in the password anyway which is really quite handy so in that

126
07:17.910 --> 07:21.470
case here I'm just going to provide these details directly so I'll say Ansible

127
07:21.470 --> 07:26.430
is the login username and the password to log into these devices with this Ans

128
07:26.430 --> 07:29.700
ible account is actually the keyword Ansible as well

129
07:29.700 --> 07:32.960
so if I just happened to show this we can see it as Ansible but right now if I
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

129
07:29.700 --> 07:32.960
so if I just happened to show this we can see it as Ansible but right now if I

130
07:32.960 --> 07:36.850
just save this now if I scroll on down a little bit what I want to do is to

131
07:36.850 --> 07:41.320
specify what my privilege escalation method is so if we happen to need to use

132
07:41.320 --> 07:43.700
super user access how do we get that

133
07:43.700 --> 07:48.370
if I hit the down arrow we get the drop down the way I actually get this is by

134
07:48.370 --> 07:52.160
saying the sudo command now what is the privilege escalation user name well

135
07:52.160 --> 07:55.880
that would be the root accounts and now I have to define what my privilege

136
07:55.880 --> 07:58.700
escalation password actually is so on the devices if I say for example go to

137
07:58.700 --> 07:58.700
the

138
07:58.700 --> 08:03.130
blue box if I want to become the super user I would say su root to substitute
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

138
07:58.700 --> 08:03.130
blue box if I want to become the super user I would say su root to substitute

139
08:03.130 --> 08:08.150
user to the root account and now I specify what the root password is now in my

140
08:08.150 --> 08:12.290
case here the password will be password one now you can see here who might I am

141
08:12.290 --> 08:16.210
the root accounts now just to be clear here this just happens to be the

142
08:16.210 --> 08:18.760
password for the root account that I created for that particular virtual

143
08:18.760 --> 08:24.130
machine at its very creation way way back at the beginning of this course it's

144
08:24.130 --> 08:27.700
nothing to do with the actual admin password that we created for the Ansible

145
08:27.700 --> 08:27.700
automation platform

146
08:27.700 --> 08:31.740
automation platform which also happens to be password one that is purely just a
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

146
08:27.700 --> 08:31.740
automation platform which also happens to be password one that is purely just a

147
08:31.740 --> 08:32.660
coincidence.

148
08:32.660 --> 08:35.810
What we're talking about here is how do we actually escalate to the root

149
08:35.810 --> 08:36.600
account on the

150
08:36.600 --> 08:40.560
machine that you're managing. So on both the yellow box and the blue box, the

151
08:40.560 --> 08:41.020
way I get

152
08:41.020 --> 08:44.500
to my root account is via the password password one. So that is what I'm going

153
08:44.500 --> 08:45.740
to supply within

154
08:45.740 --> 08:49.240
the automation platform. So again here I will just supply that information

155
08:49.240 --> 08:50.020
password one and

156
08:50.020 --> 08:54.420
we can see it is right there. Cool. So if I just scroll down and click save,

157
08:54.420 --> 08:54.780
here I now

158
08:54.780 --> 08:59.270
have my credentials and I also have to find an inventory. So check this out

159
08:59.270 --> 08:59.740
what I can

160
08:59.740 --> 09:04.430
do is I can test something out. Let me go to my inventory. Okay. And let me go
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

160
08:59.740 --> 09:04.430
do is I can test something out. Let me go to my inventory. Okay. And let me go

161
09:04.430 --> 09:04.700
to my

162
09:04.700 --> 09:08.600
Linux inventory and say for example, I want to target a particular host to test

163
09:08.600 --> 09:09.260
. Okay.

164
09:09.260 --> 09:13.420
So I'll go on to the blue box right here and then I will choose run command

165
09:13.420 --> 09:14.140
against that

166
09:14.140 --> 09:18.660
particular device. So I can choose an Ansible module. So let me go with maybe

167
09:18.660 --> 09:19.540
the command

168
09:19.540 --> 09:24.060
module and the argument and supply will simply be the IP adder commands. Now if

169
09:24.060 --> 09:24.380
I scroll

170
09:24.380 --> 09:27.830
on down, we can see some different options. We can also supply some variables

171
09:27.830 --> 09:28.380
at runtime

172
09:28.380 --> 09:31.930
if you so wish. But all I'm going to do right now is select next. Now we're
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

172
09:28.380 --> 09:31.930
if you so wish. But all I'm going to do right now is select next. Now we're

173
09:31.930 --> 09:32.700
going to specify

174
09:32.700 --> 09:36.320
what the execution environment is now by default, it will be the default

175
09:36.320 --> 09:37.620
execution environment.

176
09:37.620 --> 09:40.180
And that is what I'm going to use it is going to execute on this particular

177
09:40.180 --> 09:41.260
node right here.

178
09:41.260 --> 09:45.110
So I will just choose next. Now we specify the credentials we want to supply.

179
09:45.110 --> 09:45.340
So if I

180
09:45.340 --> 09:49.300
just choose the rail credentials, that is going to log in with the username Ans

181
09:49.300 --> 09:49.740
ible with

182
09:49.740 --> 09:54.320
the password Ansible. And if we want to go in and get root privileges, we can

183
09:54.320 --> 09:54.780
use the

184
09:54.780 --> 09:58.180
pseudo command to elevate to the root accounts. And then we can provide the

185
09:58.180 --> 09:59.180
password of password

186
09:59.180 --> 10:03.920
one if necessary in this case here, that escalation will not be necessary. So
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

186
09:59.180 --> 10:03.920
one if necessary in this case here, that escalation will not be necessary. So

187
10:03.920 --> 10:05.100
if I just choose next,

188
10:05.100 --> 10:08.260
here we get a general summary of what we're going to do and all I can do is

189
10:08.260 --> 10:09.420
select launch.

190
10:09.420 --> 10:13.420
Now the command runs. And as we can see, it says successful. Now right now, if

191
10:13.420 --> 10:14.060
I just click on

192
10:14.060 --> 10:18.670
say, for example, details and toggle back to output, we actually see the output

193
10:18.670 --> 10:18.940
from that

194
10:18.940 --> 10:22.210
particular command. You see that we can see Ansible is effectively logged into

195
10:22.210 --> 10:23.420
the blue box.

196
10:23.420 --> 10:27.660
And we have issued that particular command IP either. Scrolling on down there,

197
10:27.660 --> 10:28.380
we can see the

198
10:28.380 --> 10:34.000
output right here. There's IP address 192.168.160.134. And if I want to go back
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

198
10:28.380 --> 10:34.000
output right here. There's IP address 192.168.160.134. And if I want to go back

199
10:34.000 --> 10:34.860
, let me go to my

200
10:34.860 --> 10:39.090
inventory once again, let's go to Linux inventory. This time we'll go to groups

201
10:39.090 --> 10:40.060
. I will target,

202
10:40.060 --> 10:44.390
say for example, the USA group, and I can choose to run a command. This time I

203
10:44.390 --> 10:45.100
will just say

204
10:45.100 --> 10:49.100
touch and let's go into the 10th directory. And we'll just say a AP for Ansible

205
10:49.100 --> 10:50.140
automation platform

206
10:50.140 --> 10:53.500
dot TXT. Basically, we're just going to create a little text file. And again,

207
10:53.500 --> 10:54.620
scrolling on down,

208
10:54.620 --> 10:58.700
I'll just choose next, choose the default, I will log in with my real

209
10:58.700 --> 11:00.700
credentials. And next,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

209
10:58.700 --> 11:00.700
credentials. And next,

210
11:00.700 --> 11:04.110
and then I can just choose launch. So again, we see successful right now, if I

211
11:04.110 --> 11:04.620
just toggle

212
11:04.620 --> 11:08.390
between details and the output once again, you can see the actual general

213
11:08.390 --> 11:09.500
output. This time,

214
11:09.500 --> 11:13.290
it's on the yellow box. So let me go in to my yellow box device. Let me go to

215
11:13.290 --> 11:13.980
my terminal.

216
11:13.980 --> 11:18.600
If I just cd to the 10th directory, do an LS. And let me just scroll on up. As

217
11:18.600 --> 11:19.340
we can see here,

218
11:19.340 --> 11:24.110
we have in the created this file, a AP dot TXT. So now we can clearly see that

219
11:24.110 --> 11:24.940
we can reach our

220
11:24.940 --> 11:28.580
devices via our inventory and we can log into these devices with our

221
11:28.580 --> 11:30.140
credentials. What we now
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

221
11:28.580 --> 11:30.140
credentials. What we now

222
11:30.140 --> 11:33.420
want to be able to do is to learn how we can actually integrate our Ansible

223
11:33.420 --> 11:34.380
Playbooks directly

224
11:34.380 --> 11:37.580
within the automation controllers graphical user interface.
