1 00:00:06,860 --> 00:00:10,320 - With as many as 3,000 different modules 2 00:00:10,320 --> 00:00:12,720 having access to the appropriate documentation 3 00:00:12,720 --> 00:00:14,120 is very important. 4 00:00:14,120 --> 00:00:16,790 So let's talk about documentation a bit. 5 00:00:16,790 --> 00:00:19,730 The module documentation is in ansible-doc 6 00:00:19,730 --> 00:00:22,242 Ansible-doc in fact contains documentation 7 00:00:22,242 --> 00:00:24,140 for more than just modules. 8 00:00:24,140 --> 00:00:26,840 It has documentation for about everything. 9 00:00:26,840 --> 00:00:30,130 You can use ansible-doc -l to show a list 10 00:00:30,130 --> 00:00:34,263 of all of the modules and if you are on 2.10 or later, 11 00:00:34,263 --> 00:00:38,790 add -t module before the -l. 12 00:00:38,790 --> 00:00:41,360 And in order to figure out what you can do with a module, 13 00:00:41,360 --> 00:00:43,983 use ansible-doc modulename. 14 00:00:43,983 --> 00:00:47,180 That has all the documentation about all the arguments 15 00:00:47,180 --> 00:00:49,950 that can be used with a specific module as well. 16 00:00:49,950 --> 00:00:52,720 In particular, if you look at the examples section 17 00:00:52,720 --> 00:00:54,640 that exists at the end of documentation 18 00:00:54,640 --> 00:00:56,130 for each of the modules. 19 00:00:56,130 --> 00:00:57,410 In that section, you will find 20 00:00:57,410 --> 00:01:01,440 some common use examples of modules. 21 00:01:01,440 --> 00:01:02,273 Let me show you. 22 00:01:03,830 --> 00:01:08,690 So to start with, there is ansible-doc -t module -l 23 00:01:09,840 --> 00:01:12,820 which is shown a list of all the different modules. 24 00:01:12,820 --> 00:01:16,740 In recent 2.9 versions, the -t module option 25 00:01:16,740 --> 00:01:18,980 is supported as well. 26 00:01:18,980 --> 00:01:20,220 Just for your impression, 27 00:01:20,220 --> 00:01:25,220 find WC showing 3,387 modules in total. 28 00:01:25,700 --> 00:01:28,260 Now, if you wanna know what the module is all about, 29 00:01:28,260 --> 00:01:33,260 then you type ansible-doc on let's say, aci_filter. 30 00:01:36,690 --> 00:01:39,800 I have no idea what it is but that's just normal 31 00:01:39,800 --> 00:01:43,018 with more than 3,000 modules being available. 32 00:01:43,018 --> 00:01:45,390 But the good thing is that Ansible doc 33 00:01:45,390 --> 00:01:47,497 will describe what it is. 34 00:01:47,497 --> 00:01:50,840 So it starts with the name of the Python script behind it. 35 00:01:50,840 --> 00:01:52,880 Behind all modules, there's a Python script 36 00:01:52,880 --> 00:01:55,720 and here you can find the exact bat reference 37 00:01:55,720 --> 00:01:57,490 for the Python script. 38 00:01:57,490 --> 00:02:00,540 That's a short explanation and then we have a list 39 00:02:00,540 --> 00:02:05,140 of all the different arguments, also known as options. 40 00:02:05,140 --> 00:02:08,490 Notice that if an equals sign is used, like here, 41 00:02:08,490 --> 00:02:11,950 equals filter and equals host and equals password, 42 00:02:11,950 --> 00:02:15,020 these are mandatory options. 43 00:02:15,020 --> 00:02:18,370 Also convenient is to see also section, 44 00:02:18,370 --> 00:02:20,820 to see also sections providing information 45 00:02:20,820 --> 00:02:22,960 about related modules. 46 00:02:22,960 --> 00:02:25,810 And near the end of the documentation, 47 00:02:25,810 --> 00:02:29,070 you will find the examples. 48 00:02:29,070 --> 00:02:32,480 So this is a playbook code. 49 00:02:32,480 --> 00:02:35,400 So you need to know that what we see here 50 00:02:35,400 --> 00:02:38,290 are the arguments but it's written playbook cell. 51 00:02:38,290 --> 00:02:40,600 We'll learn more about it in the next video, 52 00:02:40,600 --> 00:02:42,980 but it's already good to know, 53 00:02:42,980 --> 00:02:47,108 to see these different options in action. 54 00:02:47,108 --> 00:02:50,400 You will find some information about return code 55 00:02:50,400 --> 00:02:53,540 and much more as well and that is what you can get 56 00:02:53,540 --> 00:02:55,620 out of Ansible-doc. 57 00:02:55,620 --> 00:02:56,840 Ansible-doc is awesome. 58 00:02:56,840 --> 00:02:59,603 So I can just recommend use it a lot.