Day-15 | Ansible Zero to Hero | #ansible #devops
Summary
TLDRIn this comprehensive DevOps tutorial, Abhishek guides viewers through the practical application of Ansible, a powerful IT automation tool. Starting with the basics, he demonstrates how to install Ansible on an EC2 instance and set up passwordless SSH for seamless server communication. The video progresses to executing ad-hoc commands and crafting Ansible playbooks in YAML format, including tasks like installing and starting Nginx. Abhishek also introduces the concept of Ansible roles to streamline complex playbooks, showcasing the structured approach to automation, ideal for configuring systems like Kubernetes clusters.
Takeaways
- π Day 15 of the complete DevOps course focuses on practical knowledge of Ansible, following a theoretical discussion from Day 14.
- π οΈ Ansible is installed initially on an EC2 instance, with recommendations to use a Linux machine for simplicity, although Mac or Windows can also be used.
- π The first practical step with Ansible is setting up passwordless authentication using SSH keys to facilitate communication with target servers.
- π Ansible uses an inventory file to manage target server addresses, which can be grouped for specific tasks or configurations.
- π€ Ansible ad-hoc commands are used for executing single or small sets of tasks directly from the command line, as opposed to writing a full playbook.
- π Ansible playbooks are written in YAML format and are used for more complex sets of tasks, such as installing and starting services like nginx.
- π§ Playbooks can be executed with the 'ansible-playbook' command, which runs the defined tasks on the specified hosts in the inventory file.
- π The 'verbose' option in Ansible commands increases the level of detail in the output, which is helpful for understanding Ansible's internal processes.
- π Ansible roles are introduced for structuring complex playbooks efficiently, sequestering tasks, variables, and other elements into organized files and folders.
- π The 'ansible-galaxy' command is used to initialize new roles, which can then be referenced in playbooks to modularize and simplify complex configurations.
- π The video script references a GitHub repository containing examples of Ansible playbooks and roles for further learning and reference.
Q & A
What is the main focus of the video script?
-The main focus of the video script is to provide a comprehensive guide on installing and using Ansible for DevOps practices, including practical knowledge and hands-on examples.
Why does the instructor recommend starting with a Linux machine for learning Ansible?
-The instructor recommends starting with a Linux machine because things are generally easier when you start doing them on Linux, although it's also possible to use Mac or Windows if a Linux machine is not available.
What is the first step in using Ansible as mentioned in the script?
-The first step in using Ansible is to install it on your machine. The script provides instructions on how to install Ansible using the package manager specific to the operating system, like apt for Ubuntu.
What is the purpose of the 'sudo apt update' command in the script?
-The 'sudo apt update' command is used to update all the packages on the system to their latest versions, which is a recommended step to perform after installing or setting up a new machine.
How does the script describe the process of setting up passwordless authentication for Ansible?
-The script explains setting up passwordless authentication by generating an SSH key pair on the Ansible server using 'ssh-keygen', and then copying the public key to the 'authorized_keys' file on the target server.
What is an Ansible Playbook and why is it used?
-An Ansible Playbook is a file that contains a set of tasks to be executed on target servers. It is used to automate and standardize the process of configuring and managing infrastructure.
What is the difference between Ansible ad-hoc commands and Ansible Playbooks as per the script?
-Ansible ad-hoc commands are used for executing single or a few tasks immediately, while Ansible Playbooks are used for executing a series of tasks, often in a more complex or structured manner.
How can multiple servers be managed using Ansible?
-Multiple servers can be managed by grouping them in the inventory file. The script mentions that Ansible can execute commands or Playbooks on specific groups of servers, such as 'web servers' or 'db servers', as defined in the inventory file.
What is the significance of the 'ansible-playbook' command mentioned in the script?
-The 'ansible-playbook' command is used to execute an Ansible Playbook. It is different from the 'ansible' command, which is used for running ad-hoc commands.
Can you explain the concept of 'become' in Ansible as described in the script?
-The 'become' concept in Ansible allows you to execute tasks with elevated privileges. In the script, 'become root' is used to switch to the root user to perform tasks that require administrative permissions.
What is the role of the 'gather_facts' step in an Ansible Playbook execution?
-The 'gather_facts' step is the first task that gets executed in every Ansible Playbook. It collects information about the target server, such as its operating system, network configuration, and installed packages, which can be used in the playbook.
How can one learn more about the internal workings of Ansible?
-To learn more about the internal workings of Ansible, the script suggests using the verbose option ('-v', '-vv', or '-vvv') with the 'ansible-playbook' command, which provides detailed debug information about the tasks being executed.
What is the purpose of the 'ansible-galaxy' command in the script?
-The 'ansible-galaxy' command is used to initialize and manage Ansible roles. In the script, it is used to create a new role for Kubernetes, which helps in organizing and structuring complex playbooks.
Can you describe the structure of an Ansible role as mentioned in the script?
-An Ansible role, as described in the script, has a specific structure that includes tasks, handlers, tests, vars, defaults, files, templates, meta, and a README. Each of these components serves a specific purpose in organizing and executing the role's tasks.
What are Ansible roles and why are they important for complex playbooks?
-Ansible roles are a way to organize and structure complex playbooks into reusable and maintainable units. They are important for complex playbooks because they improve efficiency, making it easier to manage tasks, variables, and configurations.
Outlines
π Introduction to DevOps and Ansible
In this segment, Abhishek, the host, welcomes viewers back to his channel and introduces Day 15 of the complete DevOps course. He recaps the previous session on configuration management and the role of Ansible, comparing it with Puppet. The focus of the current session is to provide practical knowledge of Ansible, starting from the basics. Abhishek shares his experience with setting up an EC2 instance on AWS for those without a Linux machine, emphasizing the ease of using Linux for Ansible. He guides through the installation of Ansible using the package manager appropriate for the user's operating system, with a demonstration using an Ubuntu instance. The importance of updating packages and using 'sudo' for root privileges is highlighted. The paragraph concludes with a verification step to ensure Ansible is installed correctly.
π Setting Up Passwordless Authentication for Ansible
Abhishek proceeds to explain the necessity of passwordless authentication for Ansible to communicate with target servers effectively. He demonstrates how to generate an SSH key pair using 'SSH-keygen' and emphasizes the importance of keeping the private key secure. The public key is then copied to the 'authorized_keys' file on the target server to enable passwordless SSH access. The process is shown for an Ubuntu machine, but Abhishek mentions that it can be adapted for other systems like CentOS. The paragraph concludes with a successful SSH connection to the target server without a password, illustrating the setup's success.
π οΈ Exploring Ansible Ad-Hoc Commands
In this part, Abhishek discusses the use of Ansible ad-hoc commands for executing simple tasks on target servers without writing a full playbook. He explains the concept of an inventory file, which lists target server IP addresses, and how to use the 'ansible' command with the inventory file to run commands like file creation on the target server. The use of modules in Ansible is introduced, with 'shell' as an example for executing shell commands on the target. The paragraph concludes by emphasizing that while playbooks are not always necessary for simple tasks, ad-hoc commands provide a quick way to perform single or a few tasks on remote servers.
π Understanding Ansible Modules and Ad-Hoc Commands
Abhishek continues the discussion on Ansible by explaining the vast array of modules available and how to find the appropriate module for specific tasks. He demonstrates using the 'shell' module to execute commands like 'nproc' and 'df' to gather system information from the target server. The paragraph also covers how to use the 'copy' module to transfer files between servers, highlighting the flexibility of Ansible's ad-hoc commands. Abhishek encourages viewers to explore the Ansible documentation to understand the modules better and to try different commands to gain hands-on experience.
π₯οΈ Grouping Servers in Ansible for Targeted Task Execution
This segment delves into the organization of servers within the Ansible inventory file, allowing for targeted execution of tasks on specific groups, such as 'web servers' or 'DB servers'. Abhishek illustrates how to group servers within the inventory file and execute Ansible commands on these groups. The explanation includes the use of the 'ansible' command with the inventory file and group names to perform operations on selected servers. The paragraph concludes with an interview question preview about grouping servers and executing tasks on specific virtual machines using Ansible.
π Writing the First Ansible Playbook for Installing and Starting Nginx
Abhishek introduces the concept of Ansible Playbooks and demonstrates writing a simple playbook to install and start Nginx on a server. He explains the YAML format used for writing playbooks and outlines the structure, including the playbook header, host specification, 'become' directive for root access, and tasks. Two tasks are defined: one for installing Nginx using the 'apt' module and another for starting the service using the 'service' module. The paragraph concludes with the execution of the playbook and a verification step to check if Nginx is running successfully on the target server.
π Using Verbose Option to Understand Ansible Internally
In this part, Abhishek discusses the use of the verbose (-v) option in Ansible to gain a deeper understanding of its internal operations. He explains how the verbose option provides detailed logs, which can be instrumental for debugging and learning the intricacies of Ansible. The example provided walks through the execution of the playbook with increased verbosity, showcasing the step-by-step process that Ansible follows to establish connections, execute tasks, and handle packages on the target server.
π Introduction to Ansible Roles for Efficient Playbook Writing
Abhishek introduces the concept of Ansible roles, explaining their purpose in structuring complex playbooks efficiently. He describes roles as a way to segregate tasks and variables, making playbooks more manageable, especially when dealing with large-scale configurations like Kubernetes clusters. The paragraph includes a demonstration of creating a new role using the 'ansible-galaxy' command and outlines the structure of the role, including various files and folders such as tasks, handlers, templates, and more. The explanation emphasizes the benefits of using roles for organized and scalable Ansible playbooks.
π Utilizing Ansible Galaxy and GitHub for Role-Based Playbook Management
This segment focuses on the practical use of Ansible Galaxy for initializing roles and GitHub for sharing and managing playbooks. Abhishek demonstrates the process of creating a role for Kubernetes using Ansible Galaxy and discusses the structure of the role with its various components. He then references his GitHub repository, where he shares tested playbooks and roles, and encourages viewers to follow it for updates and examples. The paragraph concludes with an invitation for viewers to explore the repository and use the provided examples as a learning resource.
ποΈ Dissecting the Components of Ansible Roles
Abhishek provides an in-depth explanation of the components found within an Ansible role, detailing the purpose of each folder and file. He covers the use of 'tasks' for defining actions, 'handlers' for exception management, 'defaults' and 'vars' for variable storage, 'meta' for metadata and licensing information, 'test' for unit testing, and 'templates' for file templating. The explanation aims to clarify the role structure and its components, guiding users on how to leverage roles for efficient playbook organization and execution.
π Conclusion and Further Learning Resources on Ansible
In the concluding segment, Abhishek wraps up the video by encouraging viewers to practice the concepts learned, such as Ansible ad-hoc commands and the execution of the demonstrated playbook. He also points to additional resources, including a video on the 18 most asked Ansible interview questions, for further learning. Abhishek invites feedback and questions in the comment section and expresses his gratitude for viewers' engagement, promising to address any queries in future videos.
Mindmap
Keywords
π‘DevOps
π‘Configuration Management
π‘Ansible
π‘EC2 Instance
π‘Package Manager
π‘SSH Keygen
π‘Ad-hoc Commands
π‘Playbook
π‘Inventory File
π‘YAML
π‘Roles
Highlights
Introduction to Day 15 of the Complete DevOps course focusing on practical knowledge of Ansible.
Explanation of the importance of configuration management and Ansible's role as a key player.
Comparison between Ansible and Puppet, discussing their differences and use cases.
A step-by-step guide on creating an EC2 instance for beginners to start learning Ansible.
The necessity of installing Ansible on a Linux machine and the process outlined for doing so.
Instructions on updating packages and installing Ansible using the package manager on Ubuntu.
Recommendation to use the system's package manager for easier installation and path configuration.
Verification of Ansible installation using the 'ansible --version' command.
The requirement of having at least two servers for practical Ansible demonstrations.
Demonstration of setting up passwordless authentication between servers for Ansible communication.
Explanation of SSH key generation and the importance of public and private keys in authentication.
Guide on copying the public key to the target server for passwordless SSH access.
Introduction to Ansible ad-hoc commands as an alternative to writing playbooks for simple tasks.
Difference between Ansible ad-hoc commands and playbooks, with use cases for each.
How to execute Ansible ad-hoc commands using the inventory file and module arguments.
The concept of grouping servers in the inventory file for targeted playbook execution.
Writing the first Ansible playbook to install and start Nginx, explained step by step.
Use of YAML format for writing Ansible playbooks and the significance of each section.
Execution of the Ansible playbook and the process of using the 'ansible-playbook' command.
Utilization of the verbose option for increased debug information when running Ansible.
Introduction to Ansible roles for structuring complex playbooks and improving efficiency.
Explanation of the role structure, including tasks, handlers, templates, and other components.
The ansible-galaxy command to initialize new roles for organized and scalable playbooks.
GitHub repository sharing of Ansible examples for learning and practical application.
Transcripts
hello everyone my name is Abhishek and
welcome back to my channel so today we
are at day 15 of our complete devops
course so in the previous class that is
day 14 we talked about the theory of
configuration management uh what is
configuration management why ansible has
become a key player we try to compare it
with puppet and like we talked about
various other things as well uh
regarding ansible so it was completely a
theoretical discussion and today's topic
we'll try to cover the Practical
knowledge of ansible perfect so let's
start from the basics right from the
basics uh so what I've done is I just
created an ec2 instance uh like it's
your choice if you have a Linux machine
already you can proceed with it but if
you are a first timer let's say you're
learning ansible for the very first time
I would definitely recommend you to
start with uh like you know a Linux
machine not Windows or Mac uh the reason
for that is you know things will be much
easier when you try when you start doing
on Linux but uh it's fine uh I mean if
you don't have a Linux machine and if
you can't create for some reasons a
Linux machine on ec2 instance then yeah
you can also try with your Mac or
Windows
Okay so
what is the first thing that you need to
do so the very first thing that you need
to do is to install ansible right
definitely to try any tool you need to
start with the installation of the tool
so let me show you how to install
ansible in the very first case
so there are a lot of documentations
with which talks about installation of
ansible right uh like you know you can
go to the official ansible docs as well
so if you see here this is the official
ansible docs you can also install
ansible from here
but what I would recommend you is
depending upon your uh distribution that
you have installed like for example if
you see here uh this is a Ubuntu machine
that I created from AWS like this is
easy to instance that I launched so
similarly uh like you might have
launched a sentence one or any other
thing so it comes with a default package
manager right so for example in terms of
Ubuntu I get apt so what you can
typically do is start with sudo apt
update okay Sudo is because for running
any apt commands you would need uh root
privileges so that's why you have to uh
prefix it with sudo so sudo apt update
okay as you do that your all the
packages will be updated so this is
definitely this is something that you
have to definitely do for the first time
as you install your ec2 instance so once
you do it okay so I have already done it
so it took a slightly less time but uh
in your case it might take a little more
time don't worry about it once you do it
uh you can simply do this sudo apt
install
okay
so this will install ansible for you in
my case like I told you it is already
installed and it is set to the newest
version so app did not do anything but
uh in your case once you run this
command it would install ansible for you
okay isn't it so simple like you can go
to the official ansible documentation
and try things as well but like I told
you sometimes it becomes tricky because
this documentation is a very generic one
so how does it do it basically installs
python for you then it installs pip for
you and using pip in it installs ansible
so the reason for that is basically they
wanted to keep the documentation as
generic as possible irrespective of
Windows Linux Mac or everything because
you are doing it through python uh the
installation would work but the easiest
way is uh to use your package manager
because all your package managers have
ansible as your packages so even if
you're on Mac you can simply do a brew
install uh ansible if you are on Windows
you can do chocolate a install Windows
so
uh definitely go with your own package
manager so that it is added by default
to the path as well whereas if you are
doing using this python pip sometimes
you also have to add it to your path
okay if your python is configured in a
different location
okay so we are done with the first
things that is to install ansible verify
it using this command ansible
hyphen hyphen version so as I do ansible
hyphen iPhone version you can clearly
see that it mentions that ansible is
properly installed okay
okay make sense so what is the next
thing that you have to do the next thing
is using ansible once you've I mean you
want to start playing with ansible right
so to start playing with ansible you
would need one more server yeah I mean
in the minimum you'll need two servers
that is uh this server has ansible and
to practically explain okay you need one
more server so that you know you can
configure the other server using this
ansible server right so that's the
reason why I have created two servers
okay so this is the ansible server that
we have currently logged in and this is
the target server okay let me increase
the font
so this is the target server so what
I'll do is using this ansible server
I'll configure the target server okay so
if you see both of them are Ubuntu so
that's the reason I named it as Target
Ubuntu machine
but irrespective of it you can create
anything okay it doesn't matter like I
mentioned in the previous class as well
all that ansible requires is a
passwordless authentication so if
ansible can authenticate without any
password to these machines so ansible
can do anything okay it can configure
anything on that server okay so I have
two servers now firstly I'll show you
how to set up passwordless
authentication right because as I told
you the prerequisite is ansible should
be able to communicate this server
without any password so for that let's
see how to do that okay
so uh go to this instance I mean just
click on this instance you will get uh
the private IP address like you see here
so this is the private IP address always
talk to the always talk to the private
IB address because you know both of them
are in the same VPC right and both of
both of the instants are in ec2 uh
I mean or on AWS so use the private IP
address it will be very easy
so copy this private IP address and let
me show you uh if I do SSH to it okay so
let me SSH to the private IP address it
will ask for the password because uh I
haven't configured any passwordless
authentication yet because I want to
show it to you from the scratch
Okay so
if you follow any documentations
sometimes people will confuse you
because uh like you know there are
multiple ways to configure passwordless
authentication but the easiest way okay
so some documentations might talk about
SSH copy ID okay so SSH copy ID is one
way of doing it just enter SSH copy ID
and provide the IP address of the target
server and everything will be set yes
SSH copy ID is the easiest one but what
happens is sometimes the SSH copy ID
does not have enough permissions to do
it for you so that's why I will show you
a very easy way okay and if you have any
questions to this way always uh like you
know like I always mention you put your
questions in the comment section I'll
definitely answer but I'll explain you
in a very straightforward way so I'm
pretty sure you shouldn't get any
questions
so on the Ubuntu user what you will do
is simply type
SSH hyphen Keygen okay what SSS SSH
hyphen Keygen will do for you is it will
generate a key for you right that's why
it's called SSH hyphen keychain what is
the key it will generate a public
private IP okay so that means it will
create a public key and it will create a
private key so is it asking uh it is
asking is this location fine home Ubuntu
dot SSH ID RSA yeah it's okay for me uh
it says that you already have something
can I overwrite no problem
okay in your case you might not have it
already Okay then enter so what happens
is once you do this there is a set of
files that is your public key private
key known host key known host file that
is stored in this specific location so
this directory gets created and there
are a bunch of files that are stored in
this directory okay so slash home slash
Ubuntu dot SSH so how are these things
created basically these things are
created using the command called SSH
hyphen keychain okay so you can enter
SSH hyphen keychain on your machine and
after that you get ID RSA ID RSA pob
so this is your private key and this is
your public key so private key is used
to log into this machine and private key
is something that you can that you
should never share with anybody okay so
what is that you need to share if
somebody says that okay let's
communicate with each other always go
with the public key so what we will try
to do is like I told you we will try to
talk to this target server okay from
this ansible server in a passwordless
way okay so we don't want to
authenticate using the password so for
that reason what I'll do is I'll take
this public key okay cat public key
uh sorry I'm not in that directory so uh
what I can do cat followed by this
location followed by ID underscore
RSA
dot Pub okay so this is my public key
let me copy this public key okay and
once I copy this public key what I will
do is again login to your second machine
okay that is your target server so take
a new tab okay and I'm already logged in
here let me also increase the font for
this one
okay I hope the font size is good so
this is the uh other I other server or
the target server if you see the IP
address 172 31 6228 okay now what I will
do is
just do the SSH keys in here as well
okay once you do the SSH keys in here as
well okay it will
again create the same set of files so if
you do LS
dot SSH
so you will see here that you have
authorized keys private key and public
key okay makes sense so now what we'll
do is just open the authorized
okay authorized keys in the authorized
case what you need to do is the one that
you copied here right so you open the ID
RSA Pub copied the content and then
paste the content here
okay so just paste the content from here
to
here
and just save this file now let me see
what happens okay I'll execute the SSH
command one more time okay SSH
followed by the IP address here okay
this is the IP address let me do SSH to
the Target server
enter
awesome what happened I was able to
authenticate without any password right
if you see here clearly I did not give
any password I just said SSH okay up
Arrow I just did SSH the IP address of
the target server and as I do SSH I am
able to connect to the Target server
without any password so this is the
prerequisite for your ansible right so
prerequisite for ansible is you need to
have a password
passwordless authentication and how did
I set up the passwordless authentication
in simple terms like if I have to
explain it in one single line what I did
is I just copied the public IP address
of the ansible server to the authorized
case of the target servers let's say you
will have one more server okay if you
have one more server what you will do
let's say we have a Centos server okay
so again you will follow the same steps
like uh now you already have the public
key so you don't have to do SSH key gen
what you will do is you'll just copy the
public key and you will create the
centroid server open the centralized
server that means SSH to the centralized
server in a new terminal and open the
authorized keys and paste your public
key in the authorized keys of your
Centos server then ansible will be able
to communicate or the ansible host will
be able to communicate to that Target
server in a passwordless authentication
way
awesome I hope that things are very
clear till now okay what did we do we
first step we installed ansible and
second step we set up the passwordless
authentication with ansible now we are
half done okay so these are the two
things that are important and once you
do these two things we are almost 50
done because rest all things are pretty
easy I'll show you we can write ansible
playbook in no time don't worry about it
so again ansible perfect ansible is
installed now before writing ansible
playbooks okay what is ansible Playbook
so ansible Playbook is nothing but
let's take example of shell okay in
Shell scripting you will write a file
okay and what do you call that file you
call that file as a shell script file
right if you are writing in Python you
call them as a python files so similarly
in ansible instead of calling them as
ansible files we usually call them as
playbooks that's it okay so whenever
somebody is asking you have you written
any ansible playbooks that means have
you written any ansible files okay but
is it mandatory to always write ansible
playbooks okay so like for example if
you're talking about shell so sometimes
you might only have to run some basic
shell commands like for example if I
have to list some files I can simply do
LS hyphen ldr as well right I can simply
do lsf and LTR and it listed the files
here
for that do I always have to write this
shell script saying that uh okay uh
script.sh and in the script.sh I'll say
she bang followed by slash bin slash
bash and LS7 LTR and then run this file
is it required no so you can also run
the shell commands similarly with python
you don't have to write Python scripts
all the time and execute the Python
scripts right you can simply say python3
and here you can write some commands and
your commands can get executed
answer will also support something
similar okay so my main intention to
explain all of these things is you don't
have to write playbooks all the times
okay you can also run ansible commands
from the CLI okay so it depends on the
tasks that you are doing
because the reason why I'm explaining is
I have seen uh people writing playbooks
even for simple tasks so look for
example okay this is my ansible server
okay sorry this is my ansible server and
this is my target server let's say the
task is to just create some files on
this target server okay so using ansible
your requirement that you got from your
team is that okay please use ansible and
create some files in 100 Target servers
but in our case right now we just have
one target server I'll also show you
with more Target servers don't worry
about it so we just have one target
server okay uh the task is just create
some files on the target server
this is a very simple task right so for
this simple task I don't I don't want to
write a Playbook what is the other way
so you can like I told you you can
simply run some ansible commands as well
it's not always you have to do playbooks
so in ansible terminology it is called
as ansible ad hoc commands
okay so let me show you before writing
playbooks how to run ansible ad hoc
commands so to run ansible ad hoc
commands what you can do is okay ansible
followed by
the inventory file location like if you
followed my yesterdays class I explained
what is an inventory file inventory file
is nothing but it's a file which stores
your IP addresses of the target servers
like for example I created an inventory
file here let me open this file and show
you okay cat inventory what did I do I
just added the IP address of my target
server like this is my target server and
I just added the IP address of the
target server in the inventory file okay
so this inventory file can be anywhere
okay by default ansible uh stores the
inventory file in slash Etc slash
ansible slash Host this is the default
file but you know it's not always
convenient to use it from here so
whenever you write your playbooks or
whenever you run your ads you will add
her commands uh you can store the
inventory file in the same same location
as well so that's the reason why I
stored the inventory file here if I have
10 servers what I need to do is I can
simply uh open the inventory file and
append the IP address of 10 servers
perfect so ansible
minus I the location of the inventory
file or the name of the inventory file
followed by the IP address okay what is
the IP address of your target server if
you have one target server you can
provide one target server if you have
100 Target servers you can group them in
the inventory file and you can provide
the name of the group I'll also show
that don't worry okay so because I just
have one target server I can simply say
this one or there is also another thing
that ansible supports is just say all
okay so by saying all it means
everything in the inventory file all the
servers in the inventory file
okay so ansible minus I inventory all
minus M that stands for module now you
might get a question that okay Abhishek
how do you know uh what is the module
I'll show you that as well don't worry
minus a just create a file okay touch
test or touch uh
devops
class
just run this simple command okay I'll
explain you the order of this simple
command what I am doing in the simple
command what is a module in ansible what
is this minus a which stands for
arguments okay don't worry about it but
before that just run this simple command
and see what happens
okay so what happened is answer will
give you that okay it changed something
and this yellow line means that
everything is good so if you have any
errors you will get some red color lines
which indicates that there are some
errors now let's go to the Target server
and see if the file is created LS hyphen
LTR okay if you see here devops class
and when is it created right now okay
so I just created the file so what did I
do I use the ansible
thank you
so I use the ansible ad hoc command so
is it very simple right it is very very
simple
and why will you write a Playbook you
will write a Playbook only when you want
to execute set of these commands Okay so
here there is only one comment that I
wanted to execute on the target server
right or there is only one task that I
wanted to perform on the target server
so for performing this one or two tasks
you can always go with the ansible
advert commands similarly with shell as
well right if you want to perform one or
two shell commands you can directly
execute that one or two commands for
example if I want to just say uh LS
hyphen LTR and find the size of each
file okay so what I would do I would
simply do this right LS minus LTR and if
there are 10 folders I would see the uh
like you know size of these 10 folders
using di minus sh I don't have to create
a shell script for this similarly if you
want to execute one or two ansible
commands or one or two tasks using your
ansible on your target servers always go
for advert commands the reason why I'm
stressing this is many interviewers ask
these questions what is the difference
between ansible ad hoc commands
versus ansible
Playbook okay so the difference is that
ansible advert command for one or two
does ansible Playbook is for multiple uh
commands perfect I hope the things are
clear till now okay what did we do we
installed ansible then we configured the
passwordless authentication with ansible
and we also executed ansible advert
commands to create some files or you
know to execute some tasks on the target
server this is amazing right so we did
already three different things on
ansible in no time now the question here
is okay I know many people are getting
this question here that okay how do you
know what what is this module uh called
shell and how do you know what are the
arguments to pass don't worry about it
nobody knows everything because there
are thousands of models in ansible so
you can simply open your browser and
search for ansible modules okay this is
something that everybody does okay don't
worry about it click on all modules
because day in day out ansible keeps
updating the modules because every day
they is so much contribution that is
happening to ansible then so like you
know people keep adding uh commands to
ansible people keep updating the
commands to ansibles so always go to the
documentation and like you know you want
to just create a file okay so I know
that using shell you can create so you
know this is a shell model execute shell
commands on the targets
so what I did is I just looked into the
documentation and I understood from the
documentation oh okay so ansible
supports something called as shell
commands and using the Shell command I
can create some files okay that is what
I did and ansible also provides you
examples like you know here in this case
ansible told you that okay if you want
to write a Playbook this is the yaml
syntaxing that you want to follow but
what we did we just did one single
command so that's the reason why I did
it through and you will add her comments
so minus m stands for modules and minus
a stands for what is the command that
you wanted to execute right for example
let me change this and show you
you can execute any shell commands uh
let me see what is the
number of processors on the target
server so what I did I just said n proc
and it said that okay the target server
has only one
CPU let me see
DF okay so DF is to identify what is the
disk right so disk usage and you know
everything about your disk so
I got the output using DF
perfect so this is how you can modify
the advert command arguments and you can
also do much thing many other things
like you know you know you can copy
files from this server to the other
server using the ad hoc command like uh
if you want to see that just come here
in the ansible module section just
search for copy okay so see what are the
different copy things that ansible is
providing so it said that okay so there
is an argument called copy there is a
module called copy okay so I understood
from here what I'll do is I can replace
this module from Shell to copy okay and
I need to understand what are the
arguments that's it so here you can
directly jump to the example and see
what are the arguments so for the copy
these are the different arguments that
are passed okay so simply what I can do
is in minus a I can replace this
arguments like I can say simply
SRC colon what is the location I can
provide the location of the file
after that I can say destination right
now I'm just showing it to you how to do
it okay and then
provide owner details if they are
required and all of those things so this
is how you will learn ansible ad-hoc
commands so I showed you one command you
can try different things like like you
can try copy you can try SCP you can try
uh like you know deleting files on your
target server so try all of them by your
own
now let us see what happens when you
have multiple servers right now I just
showed you with one server what I did is
I added that to the inventory file and I
showed you using executing uh this way
right so for example I said all
what if there are two different servers
okay and one set of servers is your
teams and one set of server is other
teams are let's understand this way one
set of servers are
PB servers okay database related servers
and the other set of servers are web
servers okay so there is a use case that
runs certain number of playbooks only on
the DB servers and run certain number of
playbooks only on the web servers okay
so if that is a requirement what you can
simply do is that in your inventory file
okay open the inventory file and in the
inventory file you can do grouping of
your servers okay so here you can simply
mention as DB servers
this is just for an example and here you
can mention as
web server so the brackets are very
important okay you have to definitely
use the brackets let's say I have web
servers with an IP address
172.31.62.100 okay so now if I have to
execute the ansible commands only on the
web servers what I can do is instead of
all I can simply say
web servers so what will happen is
ansible will go to the inventory file it
will look into the inventory file it
will see what are the list of web
servers okay and it will execute the
ansible commands on the list of web
servers if there is one web server it
will execute on one web server if there
are 100 web servers it will execute on
100 web servers
that means the group of machines that
are under the name called Web servers
so this is another interview question
for you so the question is that
how do you group the servers in ansible
or how can you execute certain number of
tasks only on certain number of virtual
machines using ansible so for that the
answer is that in ansible everything is
configured in inventory file all the
server names and server details are
configured in the inventory file you can
do grouping of your servers in the
inventory file and tell ansible that
okay execute this Playbook or run this
ansible command only on certain number
of servers or execute only it on web
servers or execute only it on DB servers
right
are things clear till now perfect
okay so now let's see how to write
ansible Playbook okay so the reason I
told you is to write ansible Playbook is
when you want to execute multiple tasks
so let me take a scenario okay so the
scenario here is we want to install
nginx okay and what we want to do is we
want to start nginx
okay so let's say this is the task you
want to install nginx and you also want
to start nginx so for this what you need
to do is you want to write a Playbook
perfect so let me call it as
first hyphen Playbook and in which
format is ansible playbooks written they
are written in the yaml format okay so
that's why we will say ansible
playbook.yaml
perfect so to start writing ansible
Playbook don't worry I'll definitely
keep it very very easy for you guys okay
so to to start writing ansible Playbook
just start with three hyphens okay so
the three hyphens indicates that this is
a yaml file and after that what we'll do
is you will start explaining about your
playbook that is what is the name of
your playbook okay so the name of the
Playbook let's say is to install and
start
nginx okay so after that what you will
do is you will provide the list of hosts
where this Playbook has to run
okay so to provide these details like I
told you we usually group the servers in
the inventory file and if you want to
execute in all of them so just provide
uh the server names as all so when you
provide the server names as all then it
simply gets executed on all the servers
in your inventory file
okay once that that is done so there are
two cases one is do you want to execute
this Playbook using the same user or do
you want to execute this Playbook using
the root user what do I mean by that so
there are some times where you want to
run this Playbook as root user that is
because let's say you want to install uh
Engineers so if I go to the other server
and show you if I do something like uh
apt install nginx what will happen is it
will tell you that okay unable to
acquire dpmg sorry dpk D package logs
that is because you are not a root user
so what you usually do is you use sudo
right so use sudo and then you add the
command that is because you want to
execute this command as a root user
similarly if you want to do something
similar on ansible you have to use
something called as become root okay so
what this become root does is it will
execute your ansible playbooks as a root
user
perfect once this is done you will start
writing the tasks okay so in yaml the
syntaxing might look difficult for you
for the very first time but once you
start writing it's not that difficult
okay so what we did here we started with
three hyphens which indicates that this
is the ml file and then we use this
hyphen to start the Playbook that means
this hyphen indicates that you know it's
a list so you are going to provide list
of playbooks you can write one playbook
in a file or you want to you can also
write multiple playbooks in a file so in
my case I can only write I only want to
write one one Playbook so that's why I
said okay let me start this one Playbook
and if I have multiple playbooks what I
need to do is I can also do this
okay hyphen name and
my
second
Playbook okay but don't worry about it
now we are writing only one Playbook
here
so we started with the name of the
Playbook then we told uh in which files
or on which servers this uh Playbook has
to be executed so that is the host which
takes from the inventory file so I put
here as all so that all the servers in
the inventor file gets executed then I
use the become command so what become
does is uh it will allow you to execute
it as a root user or you know you can
also use uh something called as become
underscore user and you can provide any
user that you want to
use
perfect so now inside the task again
whenever you have list of tasks okay
whenever you have list of something in
uh yaml what you need to do is you have
to start with hyphen okay which
indicates that okay so there are list of
things that you wanted to do so my first
task would be again provide the name of
the task always describe your task using
name okay so install
Engineers so this would be my first task
and what is the command I would use okay
so apt so in either you can do this okay
shell and you can say apt install nginx
so that is also quite possible
this is something that we learned right
so we use a shell command we use the
shell model and I said apt install nginx
you can also do this or ansible by
default provides a module for apt so you
can also do this like you know you can
say apt followed by name what is the
name of the module that you want to use
so I want to use I mean I want to
install nginx so provide the detail as
nginx and then you say state is present
that means to install
so this command is exactly equivalent to
shell followed by
apt install nginx
and it will also start the engine X so
uh
for that we'll write a new task but okay
so shell app install nginx and apt name
engineering State present both are the
same things now you can ask me okay if
both of them are same why do I have to
run this one okay to keep it more
generic okay so whenever you want to run
a certain number of tasks on Ubuntu okay
always go with the package manager
because sometimes when you are writing
the shell commands you might miss some
things whereas if you are using the app
which is a package manager module that
ansible is providing things will be much
easier and even into even tomorrow if
the shell command is changed or
something you can always rely on this
ansible module that is provided by the
ansible perfect apt name is nginx state
is present
this is Task number one and how do I
write the task number two again uh match
the syntax here okay match the
indentation here and in the indentation
use another hyphen and write your second
task what is my second task the second
task is to start in Linux so the first
task that I have written is to install
nginx and the second task that I've
written is to start in Linux and to
start in Linux again what you can do
there are two options here one is
you can say shell and you can say
system CTL start
Engineers or this is one possible way or
again like I mentioned above ansible
provides a module okay that is called as
a service model OKAY using the service
module you can say
what is the name of the service that is
nginx
followed by what is the state
so the state here is
started so I want to have my service in
started State that's it so our Playbook
is done we wrote our first Playbook
isn't it very simple so to write our
first Playbook what did we do we started
with three hyphens okay the three
hyphens indicate that this is a yaml
file and then we started to explain what
this Playbook is okay and why did we use
this hyphen here The Hyphen The Hyphen
here is to indicate that there can be
list of playbooks okay and this is my
first Playbook okay so in the first
Playbook what you are doing is you are
explaining install and start in Linux
and what are the hosts against which
this has to get executed so this has to
get executed against the all the hosts
in the inventory file then become root
what does this become root does is this
become root will switch the user to root
because we wanted to execute some
package manager related commands
if you just want to uh like you know
execute everything through the Ubuntu
user let's say your Ubuntu user has
permissions to do everything then you
don't have to use this line in your
playbook
okay once you provide all of these
details then you go with your actual
tasks okay in the actual task you
explain okay what is the first task and
what is the second task so in the first
task I provided install nginx okay so I
wanted to install nginx as the first one
and then I wanted to ah sorry I did not
save this file just give me a moment so
that I'll just rewrite all of these
things
okay yeah so
these are the two tasks that are created
and this is the description of the task
now once we have all of these things
okay once we have two tasks here once
you have uh written the name of your
playbook and then you have explained
everything about your playbook what you
can do is just save this file okay and
now what we'll do is we will execute
this Playbook to execute this Playbook
previously we use the ansible command
right so ansible command is used to run
some ansible commands whereas if you
want to run ansible playbooks the
command that you want to use is ansible
hyphen Playbook okay so the difference
between ansible and ansible Playbook
commands is that ansible is used to run
ansible ad-hoc commands whereas ansible
Playbook is used to run your ansible
playbook files that we have just written
perfect as always provide the location
of your inventory file if your inventory
file is in the default location then you
don't have to provide these details like
you know if you're using the slash Etc
host ansible file as your inventory file
then don't worry uh the details will be
automatically picked up but always make
sure that uh you know provide the
inventory file in the location itself so
that you know it is it will be more
convenient rather than using the default
one
after that provide the name of your
playbook okay the name of the Playbook
is
firstplaybook.yaml now let's see the
magic and let's also try to understand
what is happening
okay first of all click enter then it
said that the first task that is
executed is gathering facts the second
task that executed is installed nginx
and the third task is start engine X so
what has happened firstly gather facts
so gather fax is nothing but ansible
will try to get all the information of
your target server it will also see if
is it able to authenticate without any
password or not then it will get more
details that are required on the target
server so this is the step that gets
executed irrespective of What playbook
that you are writing okay gather facts
is the first task that gets executed
after that install nginx so install
nginx is the task that we wrote and what
happens after that start in Linux okay
so all the three tasks are passed let us
see if in nginx is installed here or not
so let's run the command sudo
system serial
status nginx let us see what has
happened
perfect it said that nginx is running
okay so we have done great job till now
what I would like to ask is everybody
who are following this video uh make
sure that you practice these examples
okay one is the ansible ad hoc command
that I showed you and also make sure you
you execute this same Playbook that I
have written Okay so it is very simple
one follow the video okay and write the
same playbook in the same order okay
and if you have any questions uh till
now I would like everybody to put that
in the comment section perfect
so we understood what is happening here
but for the viewers I wanted to show
this in detail so to read understand
what is happening within the ansible
okay what ansible is doing internally
just add the verbose okay minus V and
execute the you can add a 2v 3vs uh it
only increases the verbosity within the
ansible so if you add uh three V's that
means ansible prints whatever it is
doing with highest verbosity so what is
verbosity it basically means debug okay
so you will get the debug logs here so
previously we understood what was
happening uh just like you know ansible
created a server and all but if you use
verbose if you want to understand
ansible in more detailed way what
ansible is doing on the target server
step by step use the verbose option and
ansible gives you everything like you
know what what it has started to do
firstly when you executed this first
playbook.yaml it was searching for path
on this Ubuntu Server okay and then it
uh use some configuration options after
that it started with this install nginx
Okay where it gathered the facts The
Playbook name is install nginx it
gathered the facts C it is trying to
establish establish the SSH connection
okay so it said that okay SSH connection
was established successfully
once it established the SSH connection
then it was looking for some python uh
related stuff okay because ansible by
default uses python okay then it also
found that what is gather facts doing it
is doing all of these things one is the
SSH connection one is the uh if you are
if your target server has uh you know
all the dependencies that are required
python dependencies that are required to
execute and once that is done it will
start with the c there is lot of
information it will start with the
install in Linux and even in the install
nginx for each and every task what is it
doing how is it trying to establish the
connection and what has happened see uh
it also gave you the Json file which
indicates
what has the things that it has done so
it has installed a package for you
called nginx and it used apt to do that
we did it Force no it just used the app
it did not use any force and then D
package options everything is present
here okay so to learn ansible in a
better way use the verbose option and
that is what I did when I started to
learn ansible in the very first things
because I also also wanted to write my
own ansible modules so right now I'm
only explaining you to how to execute
your ansible playbooks but as I told you
you can always contribute to ansible and
write your own ansible modules so to
understand that you need to understand
what ansible is doing internally so for
that use the verbosity option
perfect so what we have done we have
also executed our first ansible Playbook
now
what are the next things to learn in
ansible once you learn this you need to
understand that okay so I wrote my
answerable playbook and this is looking
very simple I learned ansible completely
no
the reason here is this is a very basic
installation right we just installed
engineic and we just started the in the
next service but there are cases where
you want to use your ansible playbooks
to configure your kubernetes cluster
okay so this is a very classic example
let me tell you what I wanted to uh what
usually people do in real time
organizations let's say kubernetes.ml
okay so the task here is
create
three ec2 instances on
AWS okay and
configure
one of those
ec2 instances as master
and configure
two other
ec2 instances as worker
okay so what is the task create three
ec2 instances on AWS configure one ec2
instance as master and configure two ec2
instances as worker so for that what
usually people or what usually develops
engine is test is for this uh we use
terraform okay and for the two other
tasks we use ansible so this is uh you
done using ansible and this is also done
using ansible so people might ask can't
we do this using uh ansible we can do
that okay so we can always do uh the
installation or uh stuff like creation
using ansible as well but terraform is a
tool that is specifically designed for
that purposes okay you can create ec2
instances using ansible as well uh it's
like for example if you want to purchase
movie tickets okay you can do it through
bookmyshow as well and you can do it
through paytm as well but you would
always go for the best option right so
the best option here in this case is
terraform so terraform is an
infrastructure management tool or it's a
instruction as code tool so that's why
uh whenever you wanted to create
anything with respect to infrastructure
go with terraform so uh devops Engineers
usually create these ec2 instances using
terraform and perform these two actions
using ansible now if these two actions
cannot be written in one one simple
Playbook right for example if you look
at our first playbook.yaml this has only
two tasks but if you want to configure
both your kubernetes control plane as
well as your kubernetes data plane or
Master as well as your worker nodes
your playbook will become very huge okay
so almost you will have some 50 to 60
tasks and if you start writing this
entire 50 to 60 tasks in one
playbook.aml file it will be impossible
to read okay so for that very own reason
what ansible has done and there will be
lot of variables and there will be lot
of uh configuration files you have to
handle some errors right to avoid that
uh specific kind of problems what
ansible has done is it has come up with
a concept called ansible roles okay what
is that ansible roles
now what is ansible rules so ansible
rules is nothing but like you know in a
very simple terminology if I have to
explain your ansible roles ansible roles
is efficient way of writing ansible
playbooks that will only improve your
efficiency to write complex playbooks
okay the best example that you can do
that you can give is whenever some
interviewer interviewer is asking you
this question you can simply explain
them that okay let's say I want to
configure a kubernetes using ansible so
it will have close to some 50 to 60
tasks and you have a lot of variables
you have lot of parameters you have
certificates right you have secrets that
you have to configure while creating
this kubernetes cluster so for that very
own reason if you try to do it with
rules like you can segregate each and
everything and you can properly
structure your ansible playbooks so
that's why the concept of roles is
introduced
so if you want to start playing with
rules okay what you can simply do is you
can use this command called ansible
Galaxy okay and then you can say
initialize okay ansible Galaxy role init
stands for initialize and just start
saying that uh I want to create a role
for kubernetes okay so let me uh create
a folder for this before that
okay so this is my second playbook for
example my second Playbook is to
configure kubernetes so what I'll do is
I'll do ansible hyphen Galaxy role
init kubernetes now let us see what
happens as you execute this command okay
what happened is ansible said that role
kubernetes was created successfully what
is that let me do LS so if you see LS if
you do LS you'll see that there is a
folder called kubernetes that is created
let me open that folder and see what is
inside that okay
LS
kubernetes okay you will see bunch of
files that are created for you this is
the concept of roles okay if you do LS
hyphen LTR and see what is inside each
and every folder okay so whenever you
execute this command ansible creates you
bunch of files and folders okay and
using these files and folders you can
structure your ansible playbooks okay so
you have templates you have files you
have readme where you can explain what
this Playbook is and what are the rules
and responsibilities of this Playbook
you can create tasks like previously we
used to write tasks in the playbook.yaml
right whereas here you will use the task
and then you have handlers you have
tests vars defaults and meta I'll
explain you each and every of this thing
don't worry but till now what I wanted
to explain you is that whenever you want
to write some complicated playbooks okay
what what you would do is you will start
using the ansible Galaxy command to
create roles and what happens if you
create roles is you can write structured
and efficient ansible playbooks okay so
to write this entire playbooks in this
live session uh it will get slightly
complicated so that that's the reason
why I have put everything on my GitHub
repository okay so if you see here this
is my GitHub repository I I already know
that most of you are following me on
GitHub and if you are not then I have
the link in the description don't worry
you can
go and click on that GitHub and you will
see a repository called ansible examples
so I folk this from ansible hyphen
ansible examples but I would recommend
you to follow this repository not the
parent one because my goal is to keep
updating this ansible repository with
more examples so that whenever I create
a new example you can watch for it for
example today there is no kubernetes
example here
I don't have any kubernetes example that
is stored in this repository so in
future I'll add that thing so that you
can basically watch for it
so for example here there are a bunch of
playbooks right so let's say that I want
to look for JBoss Standalone okay I want
to install a JBoss server and I want to
configure the JBoss server so what you
will do is instead of writing everything
inside the playbook.yaml like uh this is
the playbook.yaml file so the yaml file
that is present at the parent level or
at the top of your folder is your parent
playbook.yaml that is the same as we
wrote here okay so if you remember we
wrote something called as first
playbook.aml right so this is the
site.aml side.aml is here parent
playbook.aml in this case okay what did
I provide I just provided the name of
the host and then I said that everything
else you can find in the role okay so
previously what we used to write we used
to write uh what is the name of this
Playbook what are the hosts and then we
used to write task here itself right
instead what we do is whenever we are
writing roles we just segregate and we
say that okay this is the whole us and
if you want to look at the tasks and
other details just find it in the roles
folder and what is the rules folder
JBoss Standalone okay let us see what is
there in the JBoss Standalone folder
okay go to the roles and inside roles
you have JBoss Standalone okay if you go
to jibos Standalone then we have all of
these files and folders right so
whenever you do by default you get bunch
of things if you don't require some of
these things for example here second
Playbook and inside this I have
kubernetes
CD second Playbook
okay and inside this CD kubernetes
so here you have bunch of these things
right so if you let's say you don't want
to read me dot yaml let's say you don't
want default you can delete them no
worries okay so here you have files and
let's tasks and templates so inside the
task we write everything that is related
to this task.aml okay that is all the
tasks so previously we used to write
everything on the parent playbook.yaml
but to segregate and to make things
better what you do is you create a role
and inside the role you write all of
this tasks
perfect so this is a view segregate and
improve the efficiency but what are the
other files and folders here okay I
explained what is Task but what is this
files what is this folders what is this
templates so let me explain you that as
well like for example okay so this is
the entire structure right you have
templates you have files you have tasks
you have handlers tests wires defaults
and meta let's start with meta So Meta
is basically used to write some metadata
information inside this file for example
let's say I have uh I want to provide
what are the details of this entire
Playbook what is this entire Playbook
doing so in such cases you can provide
the metadata information and also you
can provide the licensing information
that is in the future let's say you want
to share this uh playbooks or share this
entire Playbook plus role uh to the
community okay ansible Galaxy community
so in such cases what you can do is you
can write the entire information like
you know this Playbook I have written
for uh the open source purpose and I
want to share it and if anybody wants to
use it for commercial purpose it is not
allowed okay so such things you provide
in The Meta folder after that you have
defaults okay defaults is basically used
to store some variable kind of things
like for example if you go to defaults
today and open the main.yaml so default
file default file for kubernetes okay
you can store some variables and you can
do the same thing with vars folder and
also Group ads folder I'll explain you
what is the difference between each of
them in the interview questions don't
worry
and then there is test folder so test is
just like any other test that you write
uh even if you are writing uh shell
scripts or even if you're writing Python
scripts you basically add some unit
tests right so that is similar here and
then you have handlers handlers is
basically for handling some kind of
exception let's say while you are
starting uh nginx server in our previous
example we ran into some error so using
the handlers what you can do is you can
either send some mail notifications or
you know you can say that whenever This
nginx Server is failing to start there
is no purpose of installing nginx itself
so delete the nginx also okay so this
sort of things you can handle it so
Handler is basically the situations that
you want to handle
then task I don't I don't have to
explain it I know that you all are
familiar with tasks by now and readme.md
so basically you can explain uh our
viewers or you know who are watching
this repositories you can tell them that
what is the uh content of this uh uh
ansible playbooks what we stored in the
sensible playbooks and all then files
you can store some files like uh for
example you have some uh certificates or
you know uh you have some uh basic
example is let's say you have some
index.html and you want to pass this
index.html okay so in such cases you can
use uh files as well like uh for example
you want to pass the index.html onto the
uh task okay you want to copy the
index.html from here to another machine
so using the uh files folder you can
store them and you can pass so template
is for basic templating right so ansible
uses the ginger to templating and if you
want to use any anything related to this
templates you can store in the templates
folder
perfect so this is about your ansible
structure and why ansible roles are used
so you can take a reference or take a
look at these files and folders that I
stored in my GitHub repository like I
told you there are bunch of examples
okay so you can start looking at them
but before that what you need to do is
you have to be acquainted with ansible
advert commands you have to start
writing your first ansible playbooks and
then you in like you know I also showed
you how to establish password
authentication and all of these things
get familiar with them as well after
that go to this roles concept and
Implement ansible roles for that you can
pick any of the example that I have here
best start with the JBoss Standalone
okay if you have any questions with this
table Standalone uh if you tried and if
it doesn't work you can let me know but
uh pretty sure this will work because
these are all tested playbooks even
myself I have tested uh some of these
playbooks so they'll definitely work
now
if you want to learn more about the
ansible interview questions uh don't
worry I've already done a video on it uh
just to not stretch this video and to
repeat the same content I'll put the
link in the description I have put 18
most asked ansible interview questions
okay 18 answer will interview questions
and their answers so it covers all of
these topics it covers roles it covers
handlers it covers like you know uh some
uh complicated scenario based questions
on ansible so watch that video so that
you get clear understanding of what are
the interview questions that people can
ask on ansible apart from this if you
have any questions if you want me to do
uh more videos on ansible if you fail to
understand some topics on ansible do let
me know in the comment section and I'll
definitely uh do a video for you guys
I hope you enjoyed this video if you
like the video click on the like button
and if you have someone who wants to
learn ansible please share with this
share this video with them thank you so
much I'll I'll see in the next video
take care everyone bye
Browse More Related Video
Day-03 | Write Your First Ansible Playbook | For Absolute Beginners
Getting started with Ansible 13 - Adding Users & Bootstrapping
Using "loop" versus "with" in Ansible
Day-32 | How to Manage Hundreds of Kubernetes clusters ??? | KOPS | #k8s #kubernetes #devops
Ansible: Installation and Overview
VS Code Remote SSH - How to Set Up Passwordless connection
5.0 / 5 (0 votes)