1 00:00:01,190 --> 00:00:06,590 One of the very useful feature of Ansible is using roles. 2 00:00:06,590 --> 00:00:14,570 Now, what our roles roles simplifies a long playbooks by grouping tasks into smaller playbooks. 3 00:00:14,780 --> 00:00:22,550 Or you could say the role or the way of breaking a playbook or a big playbook into multiple smaller 4 00:00:22,550 --> 00:00:23,600 playbook files. 5 00:00:23,900 --> 00:00:30,710 This simplifies the writing complex playbooks, and it makes them easier to reuse now. 6 00:00:30,710 --> 00:00:38,120 Moreover, writing ansible code to manage the same servers for multiple environment can create more 7 00:00:38,120 --> 00:00:43,550 complexity, and it becomes difficult to manage everything in one single Ansible playbook. 8 00:00:43,550 --> 00:00:44,060 Right? 9 00:00:44,690 --> 00:00:49,250 Also sharing a code among other teams can be difficult. 10 00:00:49,250 --> 00:00:55,580 If you wanted to take the the playbook and share it to someone, then you have to share the whole entire 11 00:00:55,580 --> 00:00:56,060 playbook. 12 00:00:56,060 --> 00:00:57,830 You don't want to you do that. 13 00:00:57,950 --> 00:01:02,060 That is where Ansible Roll helps solve these problems. 14 00:01:02,810 --> 00:01:08,060 So roles are like templates that are most of the time static and can be handled by playbooks. 15 00:01:08,540 --> 00:01:15,890 Roles allow the entire configuration to be grouped in tasks, modules, variables and handlers. 16 00:01:15,890 --> 00:01:18,230 We already learn tasks and modules. 17 00:01:18,230 --> 00:01:23,510 We'll learn variable handlers later on in order to better understand roles. 18 00:01:23,510 --> 00:01:24,890 Let's take an example. 19 00:01:25,130 --> 00:01:30,710 Here is the list of tasks that we wanted to perform on East Web servers. 20 00:01:30,740 --> 00:01:38,780 The first task you wanted to do is to install a HTTP package, Apache package, start the service, 21 00:01:38,780 --> 00:01:44,600 then allow the HTTP servers on the firewall and restart the firewall. 22 00:01:44,600 --> 00:01:49,250 DX To reread its configuration, these are the list of four tasks. 23 00:01:49,340 --> 00:01:56,180 Now I have another list of tasks for our west of web servers and for our West Web servers. 24 00:01:56,180 --> 00:01:59,450 I just wanted to install the package and start a service. 25 00:01:59,960 --> 00:02:00,410 All right. 26 00:02:00,410 --> 00:02:04,850 So this is what I wanted to do and I wanted to do with one play playbook. 27 00:02:04,850 --> 00:02:12,320 So if you want to combine all these tasks into one playbook, then you will see it has a list of tasks 28 00:02:12,320 --> 00:02:16,130 one, two, three, four, five and six. 29 00:02:16,460 --> 00:02:25,640 So let's say if you have another group of remote clients, let's call it North Web servers and you wanted 30 00:02:25,640 --> 00:02:33,440 to do for them only start the service, then you have to create that as a seventh task. 31 00:02:33,890 --> 00:02:40,640 Or you just wanted to do install HTTP package, then you have to do as a separate seven task. 32 00:02:40,820 --> 00:02:48,020 So this makes your playbook a lot longer and of course it's hard to manage as well. 33 00:02:48,020 --> 00:02:58,100 That's when we will use the roles to make our playbooks look a lot neater, cleaner, organized and 34 00:02:58,100 --> 00:02:59,630 easy to manage. 35 00:03:00,050 --> 00:03:00,500 All right. 36 00:03:00,500 --> 00:03:07,790 By the way, when we combine these tasks, we're going to name this playbook as a by role YAML file. 37 00:03:08,450 --> 00:03:08,900 All right. 38 00:03:08,900 --> 00:03:12,920 So how are we going to transform them into different roles? 39 00:03:12,920 --> 00:03:21,170 So here is our playbook, but the first for first task for east of Web servers and the last two tasks 40 00:03:21,170 --> 00:03:22,700 for vast Web servers. 41 00:03:22,700 --> 00:03:28,940 So what we could do here is, as we could see, the first four tasks are unique to East Web servers. 42 00:03:28,940 --> 00:03:33,800 So what we will do, we will make a playbook out of this. 43 00:03:33,800 --> 00:03:36,590 Sorry, we will make a role playbook out of this. 44 00:03:36,590 --> 00:03:43,610 So the playbook will be the same as as we would write any playbook, but we will put them in the roles 45 00:03:43,610 --> 00:03:44,180 directory. 46 00:03:44,180 --> 00:03:49,490 So it will have set up a HTTP server as a name and the task will be installed. 47 00:03:49,490 --> 00:03:57,680 HTTP package, start the service, enable the HTTP port and restart the configuration and we will name 48 00:03:57,680 --> 00:03:59,480 that within the roles. 49 00:04:00,200 --> 00:04:08,420 Then the second part of this playbook is to install the HTTP package and start the service only for 50 00:04:08,420 --> 00:04:09,620 West Web servers. 51 00:04:09,620 --> 00:04:16,820 Then we could do is we could create another role and that role we could just call it basic install because 52 00:04:16,820 --> 00:04:20,960 that basic install only does the HTTP packet install and start service. 53 00:04:21,350 --> 00:04:26,630 This includes installing, starting, enabling port and restarting the firewall. 54 00:04:26,630 --> 00:04:29,360 So we will call this role as full install. 55 00:04:29,900 --> 00:04:30,260 All right. 56 00:04:30,260 --> 00:04:37,460 Once we have these roles created, then we could write our final playbook. 57 00:04:37,460 --> 00:04:41,330 And this is a very simplified version of our playbook. 58 00:04:41,780 --> 00:04:47,450 What we will do is we'll write the playbook, of course, define dash, dash, dash with the name and 59 00:04:47,450 --> 00:04:48,620 the name will call it full. 60 00:04:48,620 --> 00:04:53,600 Install the host where we will run the full install will be East Web servers, right? 61 00:04:53,600 --> 00:05:00,230 This is the list of all the four tasks we wanted to run is web servers and then we will define. 62 00:05:00,350 --> 00:05:06,020 There are roles right here now which your role you wanted to run for web server. 63 00:05:06,050 --> 00:05:08,660 We wanted to run full install role. 64 00:05:08,660 --> 00:05:16,340 And here is the list of all the tasks that we are going to put in inside of the roles called full install. 65 00:05:16,850 --> 00:05:17,910 Same thing. 66 00:05:17,930 --> 00:05:22,030 The next one is for basic install. 67 00:05:22,040 --> 00:05:22,990 That's the name. 68 00:05:23,000 --> 00:05:25,100 Where do you want to run it against? 69 00:05:25,100 --> 00:05:27,270 We want to run it against West Web servers. 70 00:05:27,290 --> 00:05:28,250 Okay. 71 00:05:28,250 --> 00:05:33,480 And which role do you want to apply on West Web server? 72 00:05:33,500 --> 00:05:36,380 We wanted to apply basic installer role. 73 00:05:36,410 --> 00:05:37,340 Okay. 74 00:05:37,370 --> 00:05:40,160 What is included in basic install? 75 00:05:40,160 --> 00:05:44,150 Basic install includes only these two tasks right here. 76 00:05:44,510 --> 00:05:45,890 These two tasks. 77 00:05:45,950 --> 00:05:46,670 Okay. 78 00:05:46,700 --> 00:05:48,530 That's it's just that simple. 79 00:05:48,530 --> 00:05:53,540 You see how neat and clean our playbook looks now. 80 00:05:53,570 --> 00:05:56,630 That's when the roles come in handy. 81 00:05:56,630 --> 00:06:06,080 So I hope at this time you understand why we need roles, especially when we have a huge and big playbook 82 00:06:06,080 --> 00:06:07,040 to deal with. 83 00:06:07,640 --> 00:06:08,250 All right. 84 00:06:08,270 --> 00:06:16,880 Moving on now, please note roles can be grouped by types of server type of applications or type of 85 00:06:16,880 --> 00:06:18,590 organization requirement. 86 00:06:18,680 --> 00:06:23,930 So to create roles, go to control node CD into expert roles. 87 00:06:23,930 --> 00:06:31,100 And by the way, by default, when we had installed Ansible, we already had the roles directory created 88 00:06:31,100 --> 00:06:31,760 for us. 89 00:06:31,850 --> 00:06:35,540 All right, once we are there, we're going to make the directory for each role. 90 00:06:35,540 --> 00:06:41,900 Meaning inside of these roles, we're going to create a new directory and we're going to call the role 91 00:06:41,900 --> 00:06:42,410 name. 92 00:06:42,410 --> 00:06:45,950 And for us, the role name is going to be basic install. 93 00:06:46,780 --> 00:06:48,250 And full install. 94 00:06:49,800 --> 00:06:57,750 So if you are doing the grouping of rolls by the type of servers, then you could have done make directory 95 00:06:57,750 --> 00:07:04,170 web servers and with MEG Directory DB servers or make directory app servers. 96 00:07:04,170 --> 00:07:13,950 So you could also have created directory by these as West Web servers or East Web servers if you are 97 00:07:13,950 --> 00:07:18,450 picking certain tasks only specifically for these servers. 98 00:07:19,260 --> 00:07:19,710 All right. 99 00:07:19,710 --> 00:07:20,960 So what is the next step? 100 00:07:20,970 --> 00:07:25,470 Next step is to create subdirectory called tasks within each directory. 101 00:07:25,470 --> 00:07:31,680 So once we create these two directory, we will create a task directory on the both of these directory 102 00:07:31,680 --> 00:07:33,180 and we'll name the same. 103 00:07:33,840 --> 00:07:37,770 The same thing we will do is create yaml files within these subdirectories. 104 00:07:37,770 --> 00:07:41,220 So the yaml file is going to be main yaml main yaml. 105 00:07:41,220 --> 00:07:47,490 So from this point on the name, the naming convention for the directories and the name of the YAML 106 00:07:47,490 --> 00:07:51,390 files remain the same, which is task task main main yaml. 107 00:07:51,400 --> 00:07:53,790 Then let's go to our control node. 108 00:07:55,140 --> 00:07:56,820 Right here is our control node. 109 00:07:56,820 --> 00:07:58,710 Let's go ahead and log in. 110 00:07:59,460 --> 00:08:01,380 To our control node. 111 00:08:02,980 --> 00:08:03,330 All right. 112 00:08:03,340 --> 00:08:05,020 Who am I? 113 00:08:05,050 --> 00:08:06,100 I'm logged in as rue. 114 00:08:06,110 --> 00:08:08,320 To which directory am I in? 115 00:08:08,350 --> 00:08:09,780 I'm in root directory. 116 00:08:09,790 --> 00:08:12,880 So let's go to Etsy and Sybil. 117 00:08:13,740 --> 00:08:19,260 Directory and when you do ls minus l, you're going to notice the rules directory already created. 118 00:08:19,260 --> 00:08:26,760 Now let's go to roles directory do ls minus l and you will notice I have already created basic install 119 00:08:26,760 --> 00:08:28,500 and full install directories. 120 00:08:28,650 --> 00:08:35,640 I have created these directories, the task directory and yaml files already so we could save some time. 121 00:08:35,850 --> 00:08:41,790 Now as I'm going through this video, you you should follow everything with me. 122 00:08:41,790 --> 00:08:45,120 You could pause the video right now and create that directory. 123 00:08:45,480 --> 00:08:47,430 Once you created the directory, come back. 124 00:08:47,430 --> 00:08:54,480 Then what we will do is we'll go into basic install directory and we'll create a directory called tasks. 125 00:08:55,410 --> 00:08:57,870 So you should have that directory by now. 126 00:08:57,870 --> 00:09:04,350 Same thing will go back to full install now and we'll create the same directory called tasks. 127 00:09:05,070 --> 00:09:08,160 Then within each of these tasks directory. 128 00:09:08,160 --> 00:09:11,790 Let's go to our first one as the basic one. 129 00:09:11,790 --> 00:09:13,290 So let's go one step back. 130 00:09:13,290 --> 00:09:18,210 Let's CD into basic directory, CD into task directory. 131 00:09:19,080 --> 00:09:25,110 And now we have main YAML file inside of the main yaml file. 132 00:09:25,320 --> 00:09:31,050 We will write our YAML file formatted role. 133 00:09:31,740 --> 00:09:32,100 All right. 134 00:09:32,100 --> 00:09:39,690 Same thing for let's verify we have the main YAML file for our full install as well. 135 00:09:39,690 --> 00:09:43,260 So right now I'm in etsi ansible rules basic install task. 136 00:09:43,380 --> 00:09:55,440 Now I will go to CD Etsy and Sybil roles full install and tasks and do ls minus l to make sure it has 137 00:09:55,440 --> 00:09:56,280 made yaml. 138 00:09:56,370 --> 00:09:57,690 Yes, it does. 139 00:09:58,080 --> 00:10:06,510 All right, now let's go into our YAML file using the Vim editor and we will define our YAML parameters 140 00:10:06,510 --> 00:10:12,150 or the task a list of tasks that we wanted to perform through the role. 141 00:10:12,570 --> 00:10:15,050 All right, let's go in. 142 00:10:15,060 --> 00:10:20,340 Let's clear the screen so we'll have a less confusing screen. 143 00:10:20,340 --> 00:10:21,690 So let's do them. 144 00:10:22,140 --> 00:10:23,970 By the way, which directory are main? 145 00:10:23,970 --> 00:10:25,230 I'm in full install. 146 00:10:25,230 --> 00:10:30,880 So full install should have all of these four tasks them main dynamo. 147 00:10:31,380 --> 00:10:37,050 And as I said, I have already wrote down this YAML file. 148 00:10:37,410 --> 00:10:38,520 Pay close attention. 149 00:10:38,520 --> 00:10:40,440 The first one is to install the package. 150 00:10:40,440 --> 00:10:42,150 It's there, use the module. 151 00:10:42,180 --> 00:10:46,260 Yum, the name of the package to be installed and what you want to do. 152 00:10:46,800 --> 00:10:55,080 Second task to start the service PD use the module service, the name of the service and state of the 153 00:10:55,080 --> 00:10:56,250 service to be started. 154 00:10:57,530 --> 00:10:59,900 Next one open port for HTTP. 155 00:11:00,320 --> 00:11:02,060 The module, the service. 156 00:11:02,060 --> 00:11:03,050 The permanent. 157 00:11:03,260 --> 00:11:06,260 Do you want it to be enabled when system reboots? 158 00:11:06,260 --> 00:11:07,830 US and the state right now. 159 00:11:07,850 --> 00:11:09,770 What do you want to do or want it to be enabled? 160 00:11:09,770 --> 00:11:14,000 Meaning allow this port on http. 161 00:11:14,030 --> 00:11:15,170 Sorry on a firewall. 162 00:11:16,040 --> 00:11:17,900 Then restart the firewall. 163 00:11:17,900 --> 00:11:19,100 Meaning restart the firewall. 164 00:11:19,100 --> 00:11:21,950 Say reread the configuration check. 165 00:11:21,950 --> 00:11:23,090 Everything is good. 166 00:11:23,360 --> 00:11:26,090 The especially the indentation should be good. 167 00:11:26,690 --> 00:11:30,770 And if everything looks good, very nice. 168 00:11:30,770 --> 00:11:32,900 Let's go ahead and save the file. 169 00:11:33,230 --> 00:11:37,730 So we our full install tasks main yaml. 170 00:11:38,730 --> 00:11:40,440 Roll is done. 171 00:11:40,800 --> 00:11:50,040 Next one is you'll do the same thing for a basic install main die yaml file and here is the list of 172 00:11:50,040 --> 00:11:50,480 tasks. 173 00:11:50,490 --> 00:12:02,520 Let's go back in to our control node and we're going to see ansible roles, basic install tasks and 174 00:12:02,520 --> 00:12:11,280 here we have our main all we'll do Vim editor to main the YAML file and we have a very basic install 175 00:12:11,280 --> 00:12:13,620 is just to install a ADB package. 176 00:12:14,220 --> 00:12:14,730 Yum. 177 00:12:14,730 --> 00:12:16,950 Is the module the name of the package? 178 00:12:16,950 --> 00:12:17,640 The state? 179 00:12:17,640 --> 00:12:19,290 Same thing with this service. 180 00:12:19,380 --> 00:12:31,080 If you notice one thing in this YAML file, we are not defining the task because that task, the directory 181 00:12:31,080 --> 00:12:36,240 that this main I.M. file is in, that directory is called tasks. 182 00:12:36,240 --> 00:12:42,420 So Ansible is smart enough to figure out that this role is the task. 183 00:12:43,300 --> 00:12:44,860 All right, so let's save it. 184 00:12:45,800 --> 00:12:49,070 I have created that already for you to save some time. 185 00:12:49,070 --> 00:12:54,170 So our basic install main yaml file is there. 186 00:12:54,320 --> 00:12:54,730 All right. 187 00:12:54,740 --> 00:12:55,870 What's the next one? 188 00:12:55,880 --> 00:13:03,140 Now go and create at see ansible playbooks by rolled out yaml file. 189 00:13:03,800 --> 00:13:04,220 All right. 190 00:13:04,220 --> 00:13:10,910 So we have this playbook that we have to write as our final playbook. 191 00:13:11,480 --> 00:13:22,250 So we'll go into our Ansible control node and we'll go into Etsy Ansible and Playbooks. 192 00:13:22,250 --> 00:13:31,400 This is the directory inside of Playbooks Directory we have a playbook called by role the YAML file. 193 00:13:31,730 --> 00:13:37,940 Let's do ls minus tr inside of this directory and you will see by role the yaml file the playbook that 194 00:13:37,940 --> 00:13:39,620 I have already created. 195 00:13:39,620 --> 00:13:46,580 Now when I do them editor by role and you will see the very first line we have defined the YAML file, 196 00:13:46,580 --> 00:13:52,730 the second line, the name of the task that we are running which is full install host where we are running 197 00:13:52,730 --> 00:13:58,550 it against, we are running it against on all hosts because we do not have a West Web server, we do 198 00:13:58,550 --> 00:14:00,050 not have East-West servers. 199 00:14:00,050 --> 00:14:07,070 So we are going with what we have and that is all and all is only one remote client that we have that 200 00:14:07,070 --> 00:14:09,320 we're going to run our full install on. 201 00:14:09,440 --> 00:14:09,950 All right. 202 00:14:10,100 --> 00:14:13,670 And the role, what do you want to do with this? 203 00:14:13,670 --> 00:14:14,540 Host? 204 00:14:14,540 --> 00:14:18,830 We wanted to run the role and the role that we have defined is called full install. 205 00:14:19,100 --> 00:14:26,420 So please pay close attention on the invitation and the formatting of this YAML file. 206 00:14:26,420 --> 00:14:31,610 So we'll define the roles right aligned vertically under name and host. 207 00:14:31,790 --> 00:14:35,090 Then the second task would be basic installed. 208 00:14:35,090 --> 00:14:37,310 And where do you want to do the basic install on? 209 00:14:37,310 --> 00:14:43,310 We'll do it on our local host, which is our Ansible control node right here and the roles that you 210 00:14:43,310 --> 00:14:45,980 want to use to run the task. 211 00:14:45,980 --> 00:14:47,750 We will use basic install. 212 00:14:48,350 --> 00:14:50,030 Everything looks the same. 213 00:14:50,030 --> 00:14:50,630 Perfect. 214 00:14:50,630 --> 00:14:53,330 Now let's go ahead and save the file. 215 00:14:55,930 --> 00:14:58,090 All right, so our file is saved. 216 00:14:58,270 --> 00:15:00,650 We created by G.M. playbook. 217 00:15:00,670 --> 00:15:01,960 Now it's time to run it. 218 00:15:02,470 --> 00:15:08,680 Before we run it, we know the full install is going to install a HTTP package on a remote client. 219 00:15:08,680 --> 00:15:11,020 So let's go to our remote client first. 220 00:15:15,140 --> 00:15:16,520 Let's log in as route. 221 00:15:16,520 --> 00:15:18,380 As you can see, I'm logging in as root. 222 00:15:18,410 --> 00:15:20,900 Hostname is our linux client one. 223 00:15:20,900 --> 00:15:27,470 And before we install DPD package, let's make sure it does not have a HTTP package already installed. 224 00:15:27,470 --> 00:15:29,000 If it does, yes, it does. 225 00:15:29,000 --> 00:15:30,800 We'll go ahead and use yum! 226 00:15:30,830 --> 00:15:33,770 Remove HTTP package. 227 00:15:34,250 --> 00:15:34,640 All right. 228 00:15:34,640 --> 00:15:35,960 So that is removed. 229 00:15:35,960 --> 00:15:38,630 It should already stop the service as well. 230 00:15:39,110 --> 00:15:40,310 All right, it's done. 231 00:15:40,310 --> 00:15:42,290 We'll check to see the firewall. 232 00:15:42,290 --> 00:15:46,790 DX firewall where we want to run. 233 00:15:47,720 --> 00:15:49,190 List all. 234 00:15:50,340 --> 00:15:56,850 We wanted to enable see it has already enabled which we will do is will remove that. 235 00:15:57,210 --> 00:16:03,630 So to remove that will use firewall cmd command dash dash. 236 00:16:03,840 --> 00:16:11,190 Permanent dash dash remove dash service equal http. 237 00:16:12,640 --> 00:16:16,750 And it should remove our HTTP service from here. 238 00:16:16,930 --> 00:16:22,300 And now let's check a list all and we'll see that http. 239 00:16:22,630 --> 00:16:24,910 It's not removed because we have to reload. 240 00:16:24,910 --> 00:16:26,350 Load the firewall. 241 00:16:27,620 --> 00:16:28,460 The. 242 00:16:31,110 --> 00:16:32,190 Configuration. 243 00:16:34,100 --> 00:16:35,150 Okay. 244 00:16:36,130 --> 00:16:37,960 I think it's Da'esh, Daesh. 245 00:16:40,200 --> 00:16:41,400 All right, it's reloaded. 246 00:16:41,400 --> 00:16:45,330 And now let's go ahead and check to see if the list HTTP is gone. 247 00:16:45,330 --> 00:16:46,590 Yes, http gone. 248 00:16:46,800 --> 00:16:47,130 All right. 249 00:16:47,130 --> 00:16:51,180 So the HTTP package has been removed. 250 00:16:51,180 --> 00:16:55,440 The HTTP service has been removed from firewall. 251 00:16:56,370 --> 00:17:03,360 It's and the next thing we'll do on the local host to make sure the local host does not have the HTTP 252 00:17:03,360 --> 00:17:04,170 package. 253 00:17:04,950 --> 00:17:05,610 All right. 254 00:17:05,610 --> 00:17:06,420 It does have it. 255 00:17:06,420 --> 00:17:07,440 So we'll do yum! 256 00:17:07,440 --> 00:17:14,490 Remove HTTP feed and it should remove it asking for confirmation. 257 00:17:21,420 --> 00:17:22,800 All right, so it is a move. 258 00:17:22,800 --> 00:17:24,180 Let's check one more time. 259 00:17:24,190 --> 00:17:26,160 RPM Q graph for http. 260 00:17:26,190 --> 00:17:27,510 Nope, nothing is there? 261 00:17:27,840 --> 00:17:28,620 All right, very good. 262 00:17:28,620 --> 00:17:31,260 Now let's clear the screen and go to our playbooks. 263 00:17:31,260 --> 00:17:37,950 We are in our playbooks and let's do less minus l tr and we'll running by role dynamic file. 264 00:17:38,040 --> 00:17:38,580 Right? 265 00:17:38,580 --> 00:17:44,580 So let's clear again, Ansible, that playbook by roll dynamo. 266 00:17:44,700 --> 00:17:46,080 Let's hit it. 267 00:17:46,170 --> 00:17:48,270 And moment of truth. 268 00:17:48,270 --> 00:17:53,250 Let's cross your finger and let's hope that it will run successfully. 269 00:17:53,400 --> 00:17:53,790 All right. 270 00:17:53,790 --> 00:18:00,120 Full install right now is running and gathering all which is our remote client, which you only got 271 00:18:00,120 --> 00:18:02,640 one remote client full install. 272 00:18:02,640 --> 00:18:06,240 So it says task is full install, which is install HTTP package. 273 00:18:06,240 --> 00:18:12,540 So it's going to full install and it's going to install the package, start the service, enable the 274 00:18:12,540 --> 00:18:13,950 port, restart the firewall. 275 00:18:13,950 --> 00:18:14,610 Good. 276 00:18:14,610 --> 00:18:16,650 Then it's coming to right here. 277 00:18:16,650 --> 00:18:18,540 The play is basic installed. 278 00:18:18,540 --> 00:18:22,170 That's the name gathering facts, which is for the local host. 279 00:18:22,200 --> 00:18:30,930 Now the task is to install basic install HTTP package right here, install and restart the service only. 280 00:18:30,930 --> 00:18:36,240 So see right here, the first task is change four, which is the four changes it made. 281 00:18:36,240 --> 00:18:43,920 The second task is to do only install package and start the services changed. 282 00:18:43,920 --> 00:18:45,000 Number two. 283 00:18:45,240 --> 00:18:47,340 All right, we didn't get any error message. 284 00:18:47,340 --> 00:18:48,300 Congratulations. 285 00:18:48,300 --> 00:18:49,230 So it worked. 286 00:18:49,260 --> 00:18:55,650 Now verified if it worked on our remote client and local host, which is our Ansible control node. 287 00:18:55,650 --> 00:19:03,450 So let's go to our client first and let's do our PM dash queue and grab for http d. 288 00:19:04,750 --> 00:19:06,010 Nice it is there. 289 00:19:06,040 --> 00:19:09,970 So now let's check the http service started or not. 290 00:19:09,970 --> 00:19:12,890 Sys ctl status hpdi. 291 00:19:12,910 --> 00:19:14,160 Yes, it has started. 292 00:19:14,170 --> 00:19:16,330 Now it's time to do the firewall. 293 00:19:17,840 --> 00:19:26,900 To check a Fed enabled HTTP port on firewall dash, dash list dash all. 294 00:19:27,200 --> 00:19:30,020 And then then yes, it did. 295 00:19:30,440 --> 00:19:31,070 Beautiful. 296 00:19:31,070 --> 00:19:34,330 So it did everything that it's supposed to do on our remote client. 297 00:19:34,340 --> 00:19:42,270 Now let's go to our local host or control node and let's see if it actually instal the package http 298 00:19:42,270 --> 00:19:42,730 feed. 299 00:19:43,340 --> 00:19:44,300 It did. 300 00:19:44,570 --> 00:19:51,230 Okay, now let's see if it started the service status, http PD and it did. 301 00:19:51,230 --> 00:19:51,540 Okay. 302 00:19:51,590 --> 00:20:00,410 You see, our tiny, small playbook, which is only by role, is just a small playbook. 303 00:20:00,410 --> 00:20:07,760 And it's doing the big things because we are separating the tasks within smaller playbooks and that's 304 00:20:07,760 --> 00:20:12,020 what the functionality or the feature of roles.