WEBVTT

1
00:00.000 --> 00:04.200
So friends, let's talk a little bit about what Ansible actually is.

2
00:04.200 --> 00:09.120
Well quite simply, at its most basic level, Ansible is an automation tool that

3
00:09.120 --> 00:09.580
has been

4
00:09.580 --> 00:11.720
developed by Red Hat.

5
00:11.720 --> 00:15.320
So think about the tasks that you would do as a Linux administrator.

6
00:15.320 --> 00:19.740
Perhaps you're managing 1000 servers and you want to go in and maybe modify the

7
00:19.740 --> 00:20.000
DNS

8
00:20.000 --> 00:24.960
settings, as opposed to having to log in to each device one by one by one.

9
00:24.960 --> 00:29.510
To manually make those configuration changes yourself, utilising a tool such as

10
00:29.510 --> 00:30.120
Ansible,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

10
00:29.510 --> 00:30.120
Ansible,

11
00:30.120 --> 00:34.710
you can have that change be automated all at once and have the system updated

12
00:34.710 --> 00:35.120
in the

13
00:35.120 --> 00:36.120
blink of an eye.

14
00:36.120 --> 00:40.400
Now the way Ansible operates, it uses something known as a push model.

15
00:40.400 --> 00:42.080
Let me just describe what that looks like.

16
00:42.080 --> 00:44.960
So imagine over here we had a Red Hat based system.

17
00:44.960 --> 00:49.900
This could just be a virtual machine and on that system you happen to install

18
00:49.900 --> 00:50.280
Ansible

19
00:50.280 --> 00:51.280
Looker.

20
00:51.280 --> 00:54.680
Here is going to be the machine that is going to manage all of the devices in

21
00:54.680 --> 00:55.400
the network.

22
00:55.400 --> 00:58.740
To say for example you had a whole ton of different servers that you're

23
00:58.740 --> 00:59.520
managing.

24
00:59.520 --> 01:03.110
One could be an Ubuntu machine, one could have it be Red Hat enterprise Linux
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

24
00:59.520 --> 01:03.110
One could be an Ubuntu machine, one could have it be Red Hat enterprise Linux

25
01:03.110 --> 01:03.680
as well,

26
01:03.680 --> 01:06.800
one could be Fedora, one could be Kali Linux, it doesn't actually matter.

27
01:06.800 --> 01:10.290
The point is if you happen to be a system administrator responsible for

28
01:10.290 --> 01:11.000
managing all

29
01:11.000 --> 01:15.490
these devices, having Ansible installed on one particular control mode will

30
01:15.490 --> 01:16.120
allow you

31
01:16.120 --> 01:21.160
to connect all of these devices at the same time and push out those updates.

32
01:21.160 --> 01:24.450
Now the reason why we refer to Ansible as using a push model to make its

33
01:24.450 --> 01:25.320
configuration

34
01:25.320 --> 01:28.860
changes is if you happen to have let's maybe say two machines over here that

35
01:28.860 --> 01:30.040
you're managing,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

35
01:28.860 --> 01:30.040
you're managing,

36
01:30.040 --> 01:34.280
the cool thing is that these devices here that happen to be managed by Ansible,

37
01:34.280 --> 01:34.320
this

38
01:34.320 --> 01:39.130
device here, these machines do not have to install any particular software you

39
01:39.130 --> 01:39.520
don't

40
01:39.520 --> 01:42.280
have to install Ansible here or here.

41
01:42.280 --> 01:46.460
You simply install Ansible on the device that is going to be performing the

42
01:46.460 --> 01:47.240
automation

43
01:47.240 --> 01:51.800
in that Ansible enabled device simply pushes out those changes to these

44
01:51.800 --> 01:53.080
different nodes.

45
01:53.080 --> 01:56.670
So all happens from here and is pushed outward towards the network, that is

46
01:56.670 --> 01:57.440
what we're referring

47
01:57.440 --> 01:58.440
to.

48
01:58.440 --> 02:00.720
Now as we move through this particular course there's going to be a strong
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

48
01:58.440 --> 02:00.720
Now as we move through this particular course there's going to be a strong

49
02:00.720 --> 02:01.360
emphasis on

50
02:01.360 --> 02:05.440
something known as YAML, pretty much this is a file format that is designed to

51
02:05.440 --> 02:06.000
be very

52
02:06.000 --> 02:10.700
human readable but it allows us to actually utilise programmatic logic, just

53
02:10.700 --> 02:11.120
like you

54
02:11.120 --> 02:15.600
can do so with say for example Python code except this time the code that we're

55
02:15.600 --> 02:16.160
writing

56
02:16.160 --> 02:20.670
quote unquote really doesn't look like code, it is very very easy on the eyes,

57
02:20.670 --> 02:20.920
really

58
02:20.920 --> 02:24.920
really easy for system administrators to look at and understand.

59
02:24.920 --> 02:28.510
Now with respect to Ansible the actual architecture can be broken down into

60
02:28.510 --> 02:30.080
four core components.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

60
02:28.510 --> 02:30.080
four core components.

61
02:30.080 --> 02:34.040
The first component is the configuration file, typically this is going to be

62
02:34.040 --> 02:36.840
called Ansible.cfg

63
02:36.840 --> 02:41.300
and using this particular file you can specify global system settings, we'll

64
02:41.300 --> 02:41.920
get to see

65
02:41.920 --> 02:44.200
what this looks like in the very next video.

66
02:44.200 --> 02:48.500
Crucially though within the configuration file we can also specify where abouts

67
02:48.500 --> 02:49.560
we can find

68
02:49.560 --> 02:54.100
the next component of the Ansible architecture and that is the Ansible

69
02:54.100 --> 02:55.080
inventory.

70
02:55.080 --> 02:59.920
Now the inventory basically tells Ansible what devices should be managed.

71
02:59.920 --> 03:03.160
Now in our lab environment we have created two particular machines that are
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

71
02:59.920 --> 03:03.160
Now in our lab environment we have created two particular machines that are

72
03:03.160 --> 03:03.600
going to

73
03:03.600 --> 03:07.740
be managed by Ansible so in order to let Ansible know about this we would

74
03:07.740 --> 03:08.960
specify information

75
03:08.960 --> 03:12.830
about those devices in the Ansible inventory so that could include things like

76
03:12.830 --> 03:13.680
the IP addresses

77
03:13.680 --> 03:17.580
of those particular devices or maybe their host names, that's how Ansible knows

78
03:17.580 --> 03:17.920
which

79
03:17.920 --> 03:20.560
devices it should actually be connecting to.

80
03:20.560 --> 03:22.830
Now as you progress throughout this course we're going to learn that the

81
03:22.830 --> 03:23.560
inventory can

82
03:23.560 --> 03:27.970
be really really valuable, it can use things such as groups as well as by the

83
03:27.970 --> 03:28.680
way groups

84
03:28.680 --> 03:33.090
within groups otherwise known as nested groups but for now as our introduction
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

84
03:28.680 --> 03:33.090
within groups otherwise known as nested groups but for now as our introduction

85
03:33.090 --> 03:33.640
we don't

86
03:33.640 --> 03:37.310
have to worry about that quite just yet, just understand that as a part of the

87
03:37.310 --> 03:37.840
Ansible

88
03:37.840 --> 03:41.440
inventory and it's one of the reasons why Ansible is so powerful.

89
03:41.440 --> 03:45.800
Now the third component I want to talk to you about, this is something known as

90
03:45.800 --> 03:46.600
variables,

91
03:46.600 --> 03:50.710
this is a very well known concept within programming because when we happen to

92
03:50.710 --> 03:52.080
be automating things

93
03:52.080 --> 03:55.390
whilst a lot of the information might be very repetitive we can just

94
03:55.390 --> 03:56.280
effectively have the

95
03:56.280 --> 04:01.010
automation system push out the same changes to all devices, we understand that
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

95
03:56.280 --> 04:01.010
automation system push out the same changes to all devices, we understand that

96
04:01.010 --> 04:01.600
with respect

97
04:01.600 --> 04:06.020
to particular configurations on particular systems we have a requirement for

98
04:06.020 --> 04:07.080
some configurations

99
04:07.080 --> 04:10.300
to be unique, basically they're not going to be the same, they're actually

100
04:10.300 --> 04:11.040
going to be

101
04:11.040 --> 04:14.320
varied depending on the device we are connecting to.

102
04:14.320 --> 04:17.580
So say for example we're managing two devices right here, let's just call it

103
04:17.580 --> 04:18.080
device one

104
04:18.080 --> 04:21.500
and device two and let's just say this is our Ansible machine right here that

105
04:21.500 --> 04:22.080
can connect

106
04:22.080 --> 04:23.080
to these devices.

107
04:23.080 --> 04:26.180
Now some things may be very common perhaps we're going to push out the same

108
04:26.180 --> 04:26.680
change to

109
04:26.680 --> 04:30.570
both devices, maybe that'd be safe for example some DNS server information
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

109
04:26.680 --> 04:30.570
both devices, maybe that'd be safe for example some DNS server information

110
04:30.570 --> 04:31.160
perhaps they're

111
04:31.160 --> 04:36.960
both going to be updated to use the server 8.8.8.8 that is absolutely fine,

112
04:36.960 --> 04:37.720
however maybe

113
04:37.720 --> 04:42.040
at the same time whilst we're giving both devices the same DNS we want to

114
04:42.040 --> 04:42.960
update their

115
04:42.960 --> 04:47.310
IP address information and the IP addresses on these devices actually have to

116
04:47.310 --> 04:47.920
be unique

117
04:47.920 --> 04:51.450
we can't give the same IP address to both devices, as you're going to see the

118
04:51.450 --> 04:51.800
way we

119
04:51.800 --> 04:55.930
solve for this particular problem is via the use of these variables now we can

120
04:55.930 --> 04:56.560
have things

121
04:56.560 --> 05:01.110
known as host variables which are variable values unique to a particular host
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

121
04:56.560 --> 05:01.110
known as host variables which are variable values unique to a particular host

122
05:01.110 --> 05:01.480
in the

123
05:01.480 --> 05:05.910
inventory but we can also have group variables these could be values unique to

124
05:05.910 --> 05:06.760
a particular

125
05:06.760 --> 05:11.300
group of devices perhaps we happen to have four devices in the UK and all of

126
05:11.300 --> 05:11.920
those UK

127
05:11.920 --> 05:16.350
devices have to get a particular NTP server that is different from all of the

128
05:16.350 --> 05:16.920
servers

129
05:16.920 --> 05:22.040
in the United States we can specify those UK unique values as a group variable

130
05:22.040 --> 05:22.760
and target

131
05:22.760 --> 05:25.840
all of the UK devices in the inventory.

132
05:25.840 --> 05:29.660
Once again we'll get to see this in more detail later on as we progress now the

133
05:29.660 --> 05:30.200
fourth and
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

133
05:29.660 --> 05:30.200
fourth and

134
05:30.200 --> 05:34.380
final component here this is known as the playbook and really this is how we

135
05:34.380 --> 05:35.400
tie everything

136
05:35.400 --> 05:40.460
together it is inside the Ansible playbook which happens to be written in YAML

137
05:40.460 --> 05:40.640
where

138
05:40.640 --> 05:45.070
we actually tell Ansible what it is we want it to do this is where we write our

139
05:45.070 --> 05:46.040
instructions

140
05:46.040 --> 05:49.490
you know like go and configure a DNS server go and update the NTP

141
05:49.490 --> 05:50.840
configurations go and

142
05:50.840 --> 05:54.500
create a whole bunch of new users on all of these devices so now we have a

143
05:54.500 --> 05:55.040
rough idea

144
05:55.040 --> 05:58.910
about what Ansible is and what it can do what we want to now do is to begin

145
05:58.910 --> 05:59.840
setting up our

146
05:59.840 --> 06:04.570
system so that we can then slowly begin automating tasks across our managed
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

146
05:59.840 --> 06:04.570
system so that we can then slowly begin automating tasks across our managed

147
06:04.570 --> 06:05.840
devices now in this

148
06:05.840 --> 06:09.410
particular skill we're not going to be looking at playbooks quite just yet or

149
06:09.410 --> 06:10.160
the concept

150
06:10.160 --> 06:13.670
of variable values but in the very next video we're going to be talking about

151
06:13.670 --> 06:14.360
the creation

152
06:14.360 --> 06:19.160
of that Ansible configuration file as well as the construction of our Ansible

153
06:19.160 --> 06:20.360
inventory

154
06:20.360 --> 06:24.570
once we have done that we will run Ansible against those devices to test for

155
06:24.570 --> 06:26.040
basic connectivity

156
06:26.040 --> 06:29.860
and that will have our lab up and running and put us in a really good place to

157
06:29.860 --> 06:30.480
continue
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

157
06:29.860 --> 06:30.480
continue

158
06:30.480 --> 06:34.680
on this journey throughout this course when we will begin using these playbooks

159
06:34.680 --> 06:35.240
to automate

160
06:35.240 --> 06:39.920
a whole bunch of really cool and useful tasks so with that said let's get going

161
06:39.920 --> 06:39.920
.
