Hey, folks.
So this is the last step of our lab setup.
We have downloaded and install Oracle Virtual Box.
Then we have downloaded and installed Linux operating system.
Now it's time to install Ansible software or Ansible engine on our Linux operating system.
All right.
So one important thing before you go ahead and install Ansible is that I want you to take a VM snapshot.
This will allow you to come back or revert back to the VM original state when you took the snapshot.
In case you do make a mistake or do some kind of misconfiguration on your Linux operating system.
All right, so go to our Oracle VirtualBox.
Right here.
Your Ansible control node is powered off.
You have this menu.
If you don't have this menu, simply click on these three dots, click on Snapshot and then click Take.
Give it a name.
I'm going to give Linux install point which will remind me this is the time when I've completed the
Linux installation click.
Okay.
All right, it's done and I'll go ahead and click Start.
All right.
While this virtual machine or this Linux operating system is starting it up, let's go to the next step,
which is Ansible installation guide can be found on this link.
So I want you to write down this link because this will give you a lot of good information of step by
step instruction on installing Ansible.
If you are installing a different version, then sent us eight, which I am going to be installing it
on.
So if I go to my Firefox, which I have already opened and I am already on that page, on this page
you will notice here's a list of all the instructions of installing Ansible on different operating system.
Right here is RHEL Center or Fedora.
These are the instructions which we will follow to install it on CentOS.
If you are doing it on a button to follow this instruction for Dave and follow this instruction and
there are other.
Unix or Linux type operating system, which you could follow the instruction and install Ansible.
All right.
Going back to our slide and going back to our virtual machine.
Our virtual machine is up.
And let's log in as our self.
Okay.
So if you notice, this is a smaller windows of a virtual box.
If you want to make this window bigger, you could right click on your desktop, go to display setting.
And right here where you see resolution.
Click on it.
Change the resolution to whichever resolution according to your requirement.
I'm going to leave it as is for now.
This is a welcome message that you're going to get every time you start it up.
You could actually quit out of it by clicking here and quit.
All right.
So going back to display will change whatever you have.
Apply the setting and it will make it bigger.
All right, click on activities.
Go to the terminal.
So you have the terminal open.
The next step is for Santos of Red Hat Fedora version seven.
You will have to run the command command jam, DNF.
DNF is going to be replacing Yum eventually.
So for now you could use either or so install EPL Daschle's and then install Ansible.
Now for Santas eight or any of the version eight, this is these are the instructions that we will follow
going back to our Linux machine to follow these instructions and install any package we have to run
the command as root, so become root.
All right, now go ahead and run the command.
Yum.
Install epi l release.
All right.
It's asking you to confirm a type of lie and confirm again.
And the package has been installed.
All right.
The next thing is jump install python.
Now with Santos eight or newer version of Red Hat or Linux, the Python package should already be installed
or installed out of the box to confirm that you can run the command rpm way and grep for python and
you'll notice they these are all the list of python packages that's already been installed.
Great.
Now the next step is to install Ansible.
So let's clear the screen and type it in Yum or DNF.
So in this this time we'll run DNF.
Install Ansible, this is the Ansible engine or software itself.
And then the next package that we will install in addition to Ansible is the Ansible documentation and.
All right, Ansible and Ansible, dock package is completed to verify it.
You can run the command rpm queue and grep for ansible.
All right.
That's their answer.
BAKER And well, Doc, the next thing is, if you are using CentOS eight, eight and the above steps
don't work, then follow these steps.
So usually version eight will come with Python three.
If it's not, then you follow these steps.
Yum, install python three and then use python package installer to install Ansible, which is pip three,
install ansible dash dock.
All right.
Moving on, if you're using RedHat eight and above steps that you followed did not work, then you have
to enable the Ansible engine repository to install Ansible and for that you will run the command subscription
dash manager repos enabled ansible repositories and then install Ansible.
All right.
So now after Ansible has been successfully installed on your Linux machine, let's confirm.
So here is our Linux machine.
Let's clear the screen and you will run the command and.
Dash.
Dash version.
And it will give you the version of the astral engine or Ansible software that has been installed.
All right.
It is there.
We confirm that.
Now run ansible command module using Peng.
So it will be Ansible.
Local host.
Dash M Peng This command is going to run as a module called Peng against the local host so simply as
if you are doing ping.
Local host and it is pinging and confirming it could ping.
The local host just like that.
We have a ping module within Ansible, by the way.
There are many, many, many more modules that we will cover later on.
But for now this is what I wanted to confirm, to see if Ansible has been installed.
All right, let's check the Ansible config files.
So let's clear the screen again.
The Ansible files, all of them are located in at see Ansible and you do listing of the files and directories.
You'll see there are roles directory which we will cover later on.
Then there is a host file.
That's where all the remote clients inventory resides.
So we every time we run a Ansible command, it comes to this file to see where the list of all the hosts
or remote clients that it has to execute the commands on.
And the last one is Ansible CFG.
If you need to make any configuration change on Ansible, you could do it on this configuration files.
All right.
The last thing, please note, if you have Linux enabled on remote nodes, you will also want to install
lib linux dash python on them before using any copy file template related function ansible.
Now you do not have to go log into each and every one of them.
What you could do is you can use the Yum module or DNF module in Ansible to install this package under
remote hosts that do not have it.
All right, so we will disable the Linux on our remote client because we are using all that set up in
our lab environment.
But if you're doing in production, then please make sure you install this lib as Linux dash python
package.
All right.
So now this completes our entire lab setup and configuration.
Now it's time to really get our hands dirty and run our Ansible automation scripts against our local
host and remote clients.