WEBVTT

1
00:00.000 --> 00:02.840
So friends, just to kick off this particular skill,

2
00:02.840 --> 00:04.640
what I want to do is to make a brief note

3
00:04.640 --> 00:07.640
about something known as collections within Ansible.

4
00:07.640 --> 00:09.680
Because as it transpires, we're going to have

5
00:09.680 --> 00:11.480
to install a particular collection

6
00:11.480 --> 00:14.480
in order to perform a particular action later on

7
00:14.480 --> 00:15.760
within this very skill.

8
00:15.760 --> 00:18.320
So quite simply when you happen to install Ansible,

9
00:18.320 --> 00:20.240
you will recall we installed something known

10
00:20.240 --> 00:21.400
as Ansible Core.

11
00:21.400 --> 00:24.360
Pretty much Ansible has become disaggregated

12
00:24.360 --> 00:26.920
and simplified so that it is much more manageable

13
00:26.920 --> 00:27.960
for the maintainers.

14
00:27.960 --> 00:29.880
Pretty much when Ansible had everything

15
00:29.880 --> 00:33.520
baked in to the products, basically it became too busy
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

15
00:29.880 --> 00:33.520
baked in to the products, basically it became too busy

16
00:33.520 --> 00:35.120
with too many components to manage

17
00:35.120 --> 00:36.200
and if there was a change,

18
00:36.200 --> 00:38.880
well it just gave the developers headaches.

19
00:38.880 --> 00:41.680
And because of this, it wasn't a very good user experience.

20
00:41.680 --> 00:44.600
So now pretty much you just install Ansible Core,

21
00:44.600 --> 00:46.560
which is maintained by Ansible.

22
00:46.560 --> 00:48.560
And if you want additional functionality,

23
00:48.560 --> 00:51.120
you can just go and install a particular collection

24
00:51.120 --> 00:53.400
dedicated to performing a particular task.

25
00:53.400 --> 00:55.320
So really what this has done is made Ansible

26
00:55.320 --> 00:57.400
more lightweight and much more modular.

27
00:57.400 --> 01:00.560
You can just add in the functionality that you need
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

27
00:57.400 --> 01:00.560
You can just add in the functionality that you need

28
01:00.560 --> 01:02.560
as you go on and like I say,

29
01:02.560 --> 01:05.320
the way we do this is via collections

30
01:05.320 --> 01:07.040
and we can actually get these collections

31
01:07.040 --> 01:08.880
utilizing Ansible Galaxy,

32
01:08.880 --> 01:11.120
which we talked about in a previous skill.

33
01:11.120 --> 01:13.120
Now you can also get collections via different ways

34
01:13.120 --> 01:15.760
such as directly via TAR Archive, that type of thing,

35
01:15.760 --> 01:19.360
but like I say, Ansible Galaxy is the easiest way to get this.

36
01:19.360 --> 01:22.000
Now these particular modules are going to have

37
01:22.000 --> 01:24.200
a fully qualified collection name.

38
01:24.200 --> 01:26.680
This is your FQ CN.

39
01:26.680 --> 01:28.280
So similar to when we happen to use,

40
01:28.280 --> 01:30.360
say for example, the copy module,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

40
01:28.280 --> 01:30.360
say for example, the copy module,

41
01:30.360 --> 01:33.440
within our Playbooks, we have been supplying the FQ CN,

42
01:33.440 --> 01:36.560
which in this case here is Ansible built in,

43
01:36.560 --> 01:39.040
which is the actual name of the collection.

44
01:39.040 --> 01:41.840
And then at the end, we actually have the module name.

45
01:41.840 --> 01:44.520
Now very often you can just supply the name of the module

46
01:44.520 --> 01:47.400
itself such as the copy module or perhaps the file module

47
01:47.400 --> 01:50.520
without supplying the FQ CN, but in my opinion,

48
01:50.520 --> 01:53.360
I just prefer to provide the full path because,

49
01:53.360 --> 01:55.520
quite honestly, it's less ambiguous.

50
01:55.520 --> 01:57.960
Some modules may have similar names.

51
01:57.960 --> 02:01.400
And by being explicit, it helps avoid any confusion
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

51
01:57.960 --> 02:01.400
And by being explicit, it helps avoid any confusion

52
02:01.400 --> 02:03.760
or accidentally using the wrong module.

53
02:03.760 --> 02:05.600
So let me just break the tension.

54
02:05.600 --> 02:07.600
The actual collection we need to install

55
02:07.600 --> 02:10.680
is called Ansible POSIX, such as Click This Link here

56
02:10.680 --> 02:13.720
and if we go down, we can see all of the modules

57
02:13.720 --> 02:16.200
within that collection along with a brief description.

58
02:16.200 --> 02:18.320
So the one we're going to be using in this particular skill

59
02:18.320 --> 02:19.880
is the authorized key module.

60
02:19.880 --> 02:22.360
So let's click this link here and it tells us a little bit

61
02:22.360 --> 02:24.040
about what this module can do.

62
02:24.040 --> 02:26.760
Now notice it's not part of Ansible Core.

63
02:26.760 --> 02:28.760
If you want to install it, you're going to have to run

64
02:28.760 --> 02:31.040
the command Ansible Galaxy Collection Install
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

64
02:28.760 --> 02:31.040
the command Ansible Galaxy Collection Install

65
02:31.040 --> 02:32.520
and then Ansible POSIX.

66
02:32.520 --> 02:34.640
So let's just copy this right here.

67
02:34.640 --> 02:37.560
So if I just paste in that command and to enter,

68
02:37.560 --> 02:40.280
give it a moment and it's going to begin downloading

69
02:40.280 --> 02:41.120
the collection.

70
02:41.120 --> 02:44.280
Now with that now done, if I just list my collections,

71
02:44.280 --> 02:46.920
now I have the POSIX collection giving me access

72
02:46.920 --> 02:50.200
to all of those modules, including the authorized key module,

73
02:50.200 --> 02:52.600
which we'll be using later on within this skill.
