1 00:00:06,290 --> 00:00:08,630 - In the previous lesson you have learned about filters. 2 00:00:08,630 --> 00:00:10,910 In this lesson, we will cover plugins. 3 00:00:10,910 --> 00:00:13,160 They are closely related and therefore, 4 00:00:13,160 --> 00:00:15,926 before we get started, I want to give you an overview 5 00:00:15,926 --> 00:00:20,230 of what exactly is used in which specific case. 6 00:00:20,230 --> 00:00:22,060 So plugins are pieces of code 7 00:00:22,060 --> 00:00:24,870 that increase Ansible core functionality. 8 00:00:24,870 --> 00:00:26,490 There's a couple of default plugins 9 00:00:26,490 --> 00:00:28,080 which I'm going to tell you about. 10 00:00:28,080 --> 00:00:30,900 And custom plugins can be added easily. 11 00:00:30,900 --> 00:00:32,240 If you want to use plugins, 12 00:00:32,240 --> 00:00:34,520 you need to activate them in ansible.cfd 13 00:00:34,520 --> 00:00:38,000 because it's additional code. It's not there by default. 14 00:00:38,000 --> 00:00:41,290 A filter is a program that allows you to modify data. 15 00:00:41,290 --> 00:00:43,310 We've talked about it in previous lesson 16 00:00:43,310 --> 00:00:46,110 and that's something that doesn't require any activation 17 00:00:46,110 --> 00:00:47,770 or whatsoever. 18 00:00:47,770 --> 00:00:50,220 And filters are typically used to change variables 19 00:00:50,220 --> 00:00:51,543 before using them. 20 00:00:53,030 --> 00:00:55,970 So in plugins, there are different types. 21 00:00:55,970 --> 00:00:57,140 There are filter plugins. 22 00:00:57,140 --> 00:01:01,680 Filter plugins are plugins that are used to modify text. 23 00:01:01,680 --> 00:01:03,963 Typically, is used in a variable. 24 00:01:05,333 --> 00:01:07,850 And we've learned about that in the previous lesson. 25 00:01:07,850 --> 00:01:09,080 There are cache plugins. 26 00:01:09,080 --> 00:01:12,150 Cache plugins are plugins that allow caching of facts. 27 00:01:12,150 --> 00:01:15,430 Inventory plugins are plugins that allow different types 28 00:01:15,430 --> 00:01:18,640 of dynamic inventory to be used. 29 00:01:18,640 --> 00:01:21,090 Lookup plugins is a very wide range 30 00:01:21,090 --> 00:01:24,660 of plugins that allows fetching data externally. 31 00:01:24,660 --> 00:01:26,400 And there are callback plugins 32 00:01:26,400 --> 00:01:27,740 which are plugins that are used 33 00:01:27,740 --> 00:01:31,040 to collect usage information about Ansible. 34 00:01:31,040 --> 00:01:32,500 And there is more. 35 00:01:32,500 --> 00:01:34,470 If you want to check it out, 36 00:01:34,470 --> 00:01:35,303 go have a look 37 00:01:35,303 --> 00:01:38,970 at docs.ansible.com/ansible/latest/plugins/plugins.html 38 00:01:38,970 --> 00:01:40,980 for the complete list. 39 00:01:40,980 --> 00:01:44,970 So to get more information about your plugins, 40 00:01:44,970 --> 00:01:47,027 use ansible.doc 41 00:01:47,027 --> 00:01:48,970 - t help 42 00:01:48,970 --> 00:01:51,313 which is giving help about the different types 43 00:01:51,313 --> 00:01:52,430 that you can use. 44 00:01:52,430 --> 00:01:55,750 And there you can see cache and callback 45 00:01:56,950 --> 00:01:58,410 and 46 00:01:58,410 --> 00:01:59,448 inventory 47 00:01:59,448 --> 00:02:01,600 and lookup. 48 00:02:01,600 --> 00:02:03,360 All of these are 49 00:02:03,360 --> 00:02:05,920 specific kinds of plugins. 50 00:02:05,920 --> 00:02:08,540 The thing is it's not listed really well, 51 00:02:08,540 --> 00:02:11,730 but if you want to know more about the cache plugins, 52 00:02:11,730 --> 00:02:13,120 well use ansible.doc 53 00:02:13,120 --> 00:02:14,410 - t cache 54 00:02:15,574 --> 00:02:17,000 - l 55 00:02:17,000 --> 00:02:17,833 to list them. 56 00:02:17,833 --> 00:02:19,770 And there you can see a couple of 57 00:02:21,240 --> 00:02:23,080 cache plugins. 58 00:02:23,080 --> 00:02:25,170 And if you're interested in callback, 59 00:02:25,170 --> 00:02:27,900 well, ansible.doc -t callback -l 60 00:02:27,900 --> 00:02:31,200 and you list all the different callback plugins. 61 00:02:31,200 --> 00:02:33,130 You can see that there's quite a couple 62 00:02:33,130 --> 00:02:36,763 of options regarding these callback plugins. 63 00:02:38,070 --> 00:02:39,190 Let's go back. 64 00:02:39,190 --> 00:02:40,390 What else do we have? 65 00:02:40,390 --> 00:02:41,480 We have 66 00:02:43,003 --> 00:02:44,340 the inventory plugins, 67 00:02:44,340 --> 00:02:45,720 the lookup plugins. 68 00:02:45,720 --> 00:02:47,610 As the last example, you know how it works. 69 00:02:47,610 --> 00:02:50,667 Now, I'm going to show you the lookup plugins. 70 00:02:50,667 --> 00:02:53,990 So ansible.doc -t lookup -l is showing 71 00:02:53,990 --> 00:02:57,180 again, an impressive list of lookup plugins 72 00:02:57,180 --> 00:02:58,520 that are available. 73 00:02:58,520 --> 00:03:01,470 So if at any case you're looking for specific plugins, 74 00:03:01,470 --> 00:03:03,280 it's always a good idea to start 75 00:03:03,280 --> 00:03:05,700 with ansible.doc -t help. 76 00:03:05,700 --> 00:03:09,270 And then on the specific type you use -l 77 00:03:09,270 --> 00:03:10,793 to show what is available.