Ansible Interview Questions And Answers 2020

  • By
  • December 28, 2019
  • Ansible
Ansible Interview Questions And Answers 2020

1. What Is Ansible?
Ans →
● Ansible is an open-source and very powerful software that helps IT Configuration Management, Deployment & Orchestration.
● This tool is very easy and simple to use yet powerful enough to automate complex multi-tier IT application environments.
● It provides consistency, scalability, and reliability to any given infrastructure.

For Free, Demo classes Call:  9028513226
Registration Link: Click Here!

2. What is Ansible language?
Ans →
● It uses a very simple YAML language with a simple structure called playbooks. Playbooks are almost the same as plain English for describing automation jobs.
● Ansible has the flexibleness to permit user-made modules which will be written in any programing language like Ruby, Python.

3. What is an inventory file?
Ans →
● Inventory is a host information file. It contains information about the servers you are managing int the form of DNS names or IPs. It is like a hosts file.
● Ansible inventories are lists of hosts or we can say nodes along with their IP addresses, servers, databases, etc. which needs to be managed by using YAML scripts.

4. What is Ansible Ad-hoc commands?
Ans →
● Sometimes we are interested to perform some basic tasks using simple and single commands on the ansible client machines. With the help of Ansible ad-hoc commands, we can perform some quick tasks and simple operations through the command line.
● But real automation works using playbooks only. you may ask me if the playbook is the real automation then Why do we use ad-hoc commands.
● The answer is so simple, Every time you may not need to perform big operations, Some time we are required to perform some simple tasks. So we don’t need to write big playbooks.
● For example, you wanted to restart or shut down all of your infrastructure servers or if you wanted to get a hostname of all servers or to get an uptime. In that case, you can use simple Ansible ad-hoc commands instead of writing playbooks.

5. What is a Playbook?
Ans →
● It is a script file. It contains all configuration commands with host information. This file performs automation through the tasks using YAML format.

6. What are the modules in Ansible?
Ans →
● Ansible ships with a variety of modules (called the ‘module library’) which will be executed directly on remote hosts or through Playbooks. Users can also write their own modules.
● These modules can system resources, like services, packages, or files (anything really), or handle executing system commands.

7. Explain plugins roles in ansibleAnsible?
Ans →
● Plugins allow executing Ansible tasks as a job build step. Plugins are pieces of code that perform core Ansible’s functionality. Ansible provides a number of handy plugins, and you can easily write your own plugin as well.

8. What are Handlers why we use handlers in Ansible?
Ans →
● We can use handler if you want to trigger service status changes, like starting, stopping and restarting a service. Ansible is a simple and really helpful tool that allows you to create groups of machines, describe how these machines should be configured or what actions should be taken on them.

9. List advantages Of Using Ansible
Ans →
– Simple: Ansible uses a simple syntax written in YAML scripts called as playbooks and is similar like python called playbooks. YAML is a high-level human-readable language it is used for data serialization. It is extraordinarily simple. So, no special coding skills are required and even people are not from an IT background they are also able to understand the syntax and meaning of the Ansible code. And able to write own playbook for network & system configuration.
– Agentless: Ansible is completely agentless. Other configuration management tools like Chef and Puppet depend on the client-side agent tool. There are no agents/software or additional firewall configuration that you need to install on the client systems or hosts which you want to automate. Ansible also reduces the effort required for your technical team to start automating right away and achieving continuous deployment.
– Powerful & Flexible: Ansible is a powerful tool because of its features that can enable you to model even the most complex IT workflows. It is more flexible so we can perform a self-sufficient task with automation, we just need to think out-of-the-box and you are ready to use everything that is needed to manage the infrastructure, networks, operating systems, and services that you are already using. With the help of Ansible’s capabilities allow you to orchestrate the entire application environment regardless of where it is deployed.
– Efficient: Ansible introduces modules as basic building blocks for your software and you can use these modules like a goal in a maven. So, you can even customize these modules as per your needs and you are ready to achieve your goals. For e.g. If you have an existing message sending module which sends messages in plain-text, and you want to send images too, you can add image sending features on top of it.

10. Explain the Ansible role in DevOps
Ans →
● In DevOps, as we know the development team and operations teamwork is an integrated way. For modern test-driven application design this integration is very important. Hence, the Ansible engine integrates this by providing a stable environment for both development and operations procedures, so we get a smooth orchestration result.
● When developers start to think about infrastructure is a part of their application i.e as Infrastructure as Code (IaC), stability and performance become normative. The process of provisioning and managing computing infrastructure (bare-metal servers, processes, virtual servers, etc.) is called Infrastructure as a Code. This is a condition where Ansible automation plays a major role.

For Free, Demo classes Call:  9028513226
Registration Link: Click Here!


Onkar Kubade | SevenMentor Pvt Ltd

Call the Trainer and Book your free demo Class for now!!!

call icon

© Copyright 2019 | Sevenmentor Pvt Ltd.

Submit Comment

Your email address will not be published. Required fields are marked *