1 00:00:00,620 --> 00:00:01,450 Hey, folks. 2 00:00:01,460 --> 00:00:04,540 So this is the last step of our lab setup. 3 00:00:04,550 --> 00:00:07,310 We have downloaded and install Oracle Virtual Box. 4 00:00:07,310 --> 00:00:10,480 Then we have downloaded and installed Linux operating system. 5 00:00:10,490 --> 00:00:17,030 Now it's time to install Ansible software or Ansible engine on our Linux operating system. 6 00:00:17,390 --> 00:00:17,810 All right. 7 00:00:17,810 --> 00:00:24,170 So one important thing before you go ahead and install Ansible is that I want you to take a VM snapshot. 8 00:00:24,260 --> 00:00:31,530 This will allow you to come back or revert back to the VM original state when you took the snapshot. 9 00:00:31,550 --> 00:00:38,450 In case you do make a mistake or do some kind of misconfiguration on your Linux operating system. 10 00:00:38,720 --> 00:00:41,750 All right, so go to our Oracle VirtualBox. 11 00:00:44,230 --> 00:00:45,040 Right here. 12 00:00:45,040 --> 00:00:47,680 Your Ansible control node is powered off. 13 00:00:47,860 --> 00:00:49,330 You have this menu. 14 00:00:49,330 --> 00:00:54,790 If you don't have this menu, simply click on these three dots, click on Snapshot and then click Take. 15 00:00:55,090 --> 00:00:56,110 Give it a name. 16 00:00:56,380 --> 00:01:03,670 I'm going to give Linux install point which will remind me this is the time when I've completed the 17 00:01:03,670 --> 00:01:04,840 Linux installation click. 18 00:01:04,840 --> 00:01:05,410 Okay. 19 00:01:06,100 --> 00:01:08,410 All right, it's done and I'll go ahead and click Start. 20 00:01:17,260 --> 00:01:17,650 All right. 21 00:01:17,650 --> 00:01:24,310 While this virtual machine or this Linux operating system is starting it up, let's go to the next step, 22 00:01:24,310 --> 00:01:28,540 which is Ansible installation guide can be found on this link. 23 00:01:28,540 --> 00:01:34,600 So I want you to write down this link because this will give you a lot of good information of step by 24 00:01:34,600 --> 00:01:37,990 step instruction on installing Ansible. 25 00:01:37,990 --> 00:01:44,440 If you are installing a different version, then sent us eight, which I am going to be installing it 26 00:01:44,440 --> 00:01:45,010 on. 27 00:01:45,340 --> 00:01:54,190 So if I go to my Firefox, which I have already opened and I am already on that page, on this page 28 00:01:54,190 --> 00:02:01,270 you will notice here's a list of all the instructions of installing Ansible on different operating system. 29 00:02:01,470 --> 00:02:04,240 Right here is RHEL Center or Fedora. 30 00:02:04,240 --> 00:02:10,570 These are the instructions which we will follow to install it on CentOS. 31 00:02:10,570 --> 00:02:16,570 If you are doing it on a button to follow this instruction for Dave and follow this instruction and 32 00:02:16,570 --> 00:02:17,830 there are other. 33 00:02:18,950 --> 00:02:26,060 Unix or Linux type operating system, which you could follow the instruction and install Ansible. 34 00:02:26,780 --> 00:02:27,320 All right. 35 00:02:27,440 --> 00:02:32,120 Going back to our slide and going back to our virtual machine. 36 00:02:32,300 --> 00:02:34,760 Our virtual machine is up. 37 00:02:36,240 --> 00:02:38,640 And let's log in as our self. 38 00:02:44,840 --> 00:02:45,140 Okay. 39 00:02:45,140 --> 00:02:48,770 So if you notice, this is a smaller windows of a virtual box. 40 00:02:48,770 --> 00:02:53,690 If you want to make this window bigger, you could right click on your desktop, go to display setting. 41 00:02:56,260 --> 00:02:58,630 And right here where you see resolution. 42 00:02:59,490 --> 00:03:00,240 Click on it. 43 00:03:01,400 --> 00:03:07,060 Change the resolution to whichever resolution according to your requirement. 44 00:03:07,070 --> 00:03:09,500 I'm going to leave it as is for now. 45 00:03:10,890 --> 00:03:15,810 This is a welcome message that you're going to get every time you start it up. 46 00:03:15,810 --> 00:03:18,840 You could actually quit out of it by clicking here and quit. 47 00:03:19,620 --> 00:03:19,950 All right. 48 00:03:19,950 --> 00:03:22,590 So going back to display will change whatever you have. 49 00:03:22,590 --> 00:03:24,660 Apply the setting and it will make it bigger. 50 00:03:24,660 --> 00:03:25,920 All right, click on activities. 51 00:03:26,580 --> 00:03:28,080 Go to the terminal. 52 00:03:28,380 --> 00:03:30,100 So you have the terminal open. 53 00:03:30,120 --> 00:03:35,610 The next step is for Santos of Red Hat Fedora version seven. 54 00:03:35,610 --> 00:03:38,580 You will have to run the command command jam, DNF. 55 00:03:38,580 --> 00:03:43,230 DNF is going to be replacing Yum eventually. 56 00:03:43,500 --> 00:03:50,220 So for now you could use either or so install EPL Daschle's and then install Ansible. 57 00:03:50,430 --> 00:03:57,720 Now for Santas eight or any of the version eight, this is these are the instructions that we will follow 58 00:03:57,720 --> 00:04:03,630 going back to our Linux machine to follow these instructions and install any package we have to run 59 00:04:03,630 --> 00:04:07,350 the command as root, so become root. 60 00:04:08,840 --> 00:04:11,450 All right, now go ahead and run the command. 61 00:04:11,450 --> 00:04:12,050 Yum. 62 00:04:12,050 --> 00:04:16,580 Install epi l release. 63 00:04:24,090 --> 00:04:24,840 All right. 64 00:04:24,840 --> 00:04:29,340 It's asking you to confirm a type of lie and confirm again. 65 00:04:29,520 --> 00:04:32,250 And the package has been installed. 66 00:04:32,280 --> 00:04:32,580 All right. 67 00:04:32,580 --> 00:04:35,220 The next thing is jump install python. 68 00:04:35,700 --> 00:04:44,400 Now with Santos eight or newer version of Red Hat or Linux, the Python package should already be installed 69 00:04:44,610 --> 00:04:54,000 or installed out of the box to confirm that you can run the command rpm way and grep for python and 70 00:04:54,000 --> 00:04:58,290 you'll notice they these are all the list of python packages that's already been installed. 71 00:04:58,380 --> 00:04:59,010 Great. 72 00:04:59,040 --> 00:05:01,590 Now the next step is to install Ansible. 73 00:05:01,830 --> 00:05:06,240 So let's clear the screen and type it in Yum or DNF. 74 00:05:06,240 --> 00:05:08,790 So in this this time we'll run DNF. 75 00:05:10,160 --> 00:05:14,780 Install Ansible, this is the Ansible engine or software itself. 76 00:05:14,840 --> 00:05:22,370 And then the next package that we will install in addition to Ansible is the Ansible documentation and. 77 00:05:31,060 --> 00:05:36,490 All right, Ansible and Ansible, dock package is completed to verify it. 78 00:05:36,490 --> 00:05:39,940 You can run the command rpm queue and grep for ansible. 79 00:05:41,700 --> 00:05:42,000 All right. 80 00:05:42,000 --> 00:05:42,660 That's their answer. 81 00:05:42,660 --> 00:05:49,470 BAKER And well, Doc, the next thing is, if you are using CentOS eight, eight and the above steps 82 00:05:49,470 --> 00:05:52,200 don't work, then follow these steps. 83 00:05:52,200 --> 00:05:55,050 So usually version eight will come with Python three. 84 00:05:55,500 --> 00:05:57,810 If it's not, then you follow these steps. 85 00:05:57,900 --> 00:06:06,270 Yum, install python three and then use python package installer to install Ansible, which is pip three, 86 00:06:06,270 --> 00:06:08,580 install ansible dash dock. 87 00:06:08,880 --> 00:06:09,420 All right. 88 00:06:09,420 --> 00:06:15,630 Moving on, if you're using RedHat eight and above steps that you followed did not work, then you have 89 00:06:15,630 --> 00:06:21,780 to enable the Ansible engine repository to install Ansible and for that you will run the command subscription 90 00:06:21,780 --> 00:06:27,810 dash manager repos enabled ansible repositories and then install Ansible. 91 00:06:28,260 --> 00:06:28,620 All right. 92 00:06:28,620 --> 00:06:34,980 So now after Ansible has been successfully installed on your Linux machine, let's confirm. 93 00:06:35,690 --> 00:06:37,760 So here is our Linux machine. 94 00:06:37,760 --> 00:06:41,360 Let's clear the screen and you will run the command and. 95 00:06:42,740 --> 00:06:43,190 Dash. 96 00:06:43,190 --> 00:06:44,220 Dash version. 97 00:06:45,350 --> 00:06:51,290 And it will give you the version of the astral engine or Ansible software that has been installed. 98 00:06:51,440 --> 00:06:51,950 All right. 99 00:06:51,950 --> 00:06:52,670 It is there. 100 00:06:52,670 --> 00:06:53,860 We confirm that. 101 00:06:53,870 --> 00:06:58,970 Now run ansible command module using Peng. 102 00:06:59,000 --> 00:07:00,560 So it will be Ansible. 103 00:07:00,830 --> 00:07:02,090 Local host. 104 00:07:02,930 --> 00:07:15,290 Dash M Peng This command is going to run as a module called Peng against the local host so simply as 105 00:07:15,290 --> 00:07:16,720 if you are doing ping. 106 00:07:16,790 --> 00:07:20,870 Local host and it is pinging and confirming it could ping. 107 00:07:20,870 --> 00:07:22,530 The local host just like that. 108 00:07:22,550 --> 00:07:25,810 We have a ping module within Ansible, by the way. 109 00:07:25,820 --> 00:07:29,960 There are many, many, many more modules that we will cover later on. 110 00:07:29,960 --> 00:07:35,510 But for now this is what I wanted to confirm, to see if Ansible has been installed. 111 00:07:35,780 --> 00:07:38,150 All right, let's check the Ansible config files. 112 00:07:38,570 --> 00:07:40,960 So let's clear the screen again. 113 00:07:40,970 --> 00:07:50,060 The Ansible files, all of them are located in at see Ansible and you do listing of the files and directories. 114 00:07:50,060 --> 00:07:53,420 You'll see there are roles directory which we will cover later on. 115 00:07:53,450 --> 00:07:55,280 Then there is a host file. 116 00:07:55,280 --> 00:08:00,020 That's where all the remote clients inventory resides. 117 00:08:00,020 --> 00:08:07,730 So we every time we run a Ansible command, it comes to this file to see where the list of all the hosts 118 00:08:07,730 --> 00:08:11,300 or remote clients that it has to execute the commands on. 119 00:08:11,420 --> 00:08:13,380 And the last one is Ansible CFG. 120 00:08:13,410 --> 00:08:18,950 If you need to make any configuration change on Ansible, you could do it on this configuration files. 121 00:08:19,490 --> 00:08:20,050 All right. 122 00:08:20,060 --> 00:08:26,840 The last thing, please note, if you have Linux enabled on remote nodes, you will also want to install 123 00:08:26,870 --> 00:08:32,450 lib linux dash python on them before using any copy file template related function ansible. 124 00:08:32,780 --> 00:08:36,560 Now you do not have to go log into each and every one of them. 125 00:08:36,800 --> 00:08:42,890 What you could do is you can use the Yum module or DNF module in Ansible to install this package under 126 00:08:42,890 --> 00:08:45,260 remote hosts that do not have it. 127 00:08:45,920 --> 00:08:53,480 All right, so we will disable the Linux on our remote client because we are using all that set up in 128 00:08:53,480 --> 00:08:54,410 our lab environment. 129 00:08:54,410 --> 00:09:01,280 But if you're doing in production, then please make sure you install this lib as Linux dash python 130 00:09:01,490 --> 00:09:02,360 package. 131 00:09:03,110 --> 00:09:03,410 All right. 132 00:09:03,410 --> 00:09:08,500 So now this completes our entire lab setup and configuration. 133 00:09:08,510 --> 00:09:16,310 Now it's time to really get our hands dirty and run our Ansible automation scripts against our local 134 00:09:16,310 --> 00:09:18,020 host and remote clients.