All Courses
Ansible Interview Questions

Ansible Interview Questions and Answers

Ansible Interview Questions and Answers

In case you’re searching for Ansible Interview Questions and Answers for Experienced or Freshers, you are at the correct place. Additionally Our Ansible Online Training educates the learners for the inventory configuration and cloud integration. Ansible is one of the tools used in the DevOps toolchain and functions as an administration tool for automation. Ansible Online Course will enhance the knowledge about the usage of set up, inventory, playbooks of Ansible, provisioners, infrastructure with Ansible, deployment with ansible, testing, and continuous integration Docker container with Ansible. Github, Bugzilla, and Atlassian are some of the competitive product for Ansible in the IT market. Demand for Ansible is huge in the countries like United States, United Kingdom, France and Canada.

To join the global community of Ansible followers GangBoard offers the best Ansible Online Certification Training. Find the interview question and answer listed to test the knowledge after the completion of the formal training.
There is parcel of chances from many presumed organizations on the planet. The Ansible advertise is relied upon to develop to more than $5 billion by 2020, from just $180 million, as per Ansible industry gauges. In this way, despite everything you have the chance to push forward in your vocation in Ansible Development. GangBoard offers Advanced Ansible Interview Questions and Answers that assist you in splitting your Ansible interview and procure dream vocation as Ansible Developer.

Best Ansible Interview Questions and Answers

Do you believe that you have the right stuff to be a section in the advancement of future Ansible, the GangBoard is here to control you to sustain your vocation. Various fortune 1000 organizations around the world are utilizing the innovation of Ansible to meet the necessities of their customers. Ansible is being utilized as a part of numerous businesses. To have a great development in Ansible work, our page furnishes you with nitty-gritty data as Ansible prospective employee meeting questions and answers. Ansible Interview Questions and answers are prepared by 10+ years experienced industry experts.

Ansible Interview Questions and answers are very useful to the Fresher or Experienced person who is looking for the new challenging job from the reputed company. Our Ansible Questions and answers are very simple and have more examples for your better understanding. By this Ansible Interview Questions and answers, many students are got placed in many reputed companies with high package salary. So utilize our Ansible Interview Questions and answers to grow in your career.  

Q1) What do you know about Ansible?

Answer: Ansible is the well-recognized open-source platform written and developed in Python language. This platform facilitates task automation, configuration management, and application deployment. It uses the SSH approach to deploy the application without any specific downtime.

Q2) Explain the use of Ansible?

Answer: automation is a crucial part of any software development process. The Ansible platform used in managing various IT infrastructure. It is also used for deploying software applications to remote nodes.

Q3) What are the major advantages of using Ansible?

Answer: Using Ansible can be beneficial in numerous ways. Then three of its advantages are mentioned below:

  • Agentless
  • Very low overhead and easy to learn
  • Great performance
  • Consistent with security
  • Reliable

Q4) Explain the Ansible Galaxy.

Answer: As Ansible facilitates bundling automation content. This makes it reusable. The Ansible galleries are needed here to share such Ansible roles. In simple words, the Ansible gallery is the tool which is merged with the Ansible. This integration creates the base directory structure.

Q5) What is continuous delivery in terms of Ansible?

Answer: It is the practice that involves delivering the software as soon as it is developed. For this, there is a need to use the versioning control system. Even in the live production system the software consistently updates.

Q6) How do Ansible works?

Answer: There are two main categories of server type in Ansible: the nodes and controlling machine. It simply uses the SSH protocol to deploy modules to nodes. These nodes stored in remote nodes interact with Ansible Machine. The Ansible has the capability to manage more than 100 nodes in one single system.

Q7) Name different modules in Ansible.

Answer: In Ansible there are two major types of modules: core modules and extra modules.
Core Modules: These modules are the first preference of the Ansible team. The core modules come with Ansible software.
Extra Modules: The extra modules are reusable but for some reason, they always get a lower rate of response to issues. These are also maintained and managed by the Ansible Community. Although the extra modules are merged with Ansible but one can use it separately in the future.

Q8) Explain the Ansible tower.

Answer: The Ansible is the web-based center which is used for all kind of automation tasks. There is no requirement to install the daemons to connect with other controlling machines as it is an agentless model. The Ansible tower allows you free usage till ten nodes.

Q9) What is the difference between Ansible and Puppet?

Answer: Ansible: The Ansible has the simplest technology written in the YAML language. It can be quickly installed and deployed because of agent-less architecture. The Ansible supports automated workflow for continuous delivery.
Puppet: The puppet has complex technology in comparison to Ansible. This is written in Ruby language. To access this, it is important to learn Puppet DSL.

Q10) Give a brief about Ansible architecture.

Answer: The Ansible is highly based on the agent-less architecture. This structure enables you to connect your nodes. The pool of modules can dwell on any system without any daemons, server or the database. The SSH protocol enables it to execute these modules. It removes them as soon as work is done.

Q11) What’s the difference between the environment variable and variable name?

Answer: The variable name can be created by adding stings. On the other hand, for the access of environment variable, there is a need to access the existing variables. The variable name uses ipv4 for the available name. For remote environment variables {{ ansible_env.SOME_VARIABLE }} is used.

Q12) What are the things Ansible can do?

Answer: With the Ansible these are the following things one can do:

  • Deployment of application
  • Configuration management
  • Task automation
  • IT orchestration

Q13) What language Ansible is written in?

Answer: The Ansible is written in PowerShell and Python programming language.

Q14) Can you please explain the meaning of the red hat Ansible?

Answer: The red hat Ansible and Ansible both all the great automation platforms. The end to end complete automation of these platforms makes it capable to provide below-mentioned functionalities:

  • Application deployment
  • Provisioning
  • Management and configuration of IT systems
  • Orchestrating workflows

Q15) What are the requirements of the Ansible server?

Answer: For the window users, there is a need for the virtual machine in which the Linux should be installed. Otherwise, the Ansible requires Python 2.6 version or the higher one.

Q16) Is it possible to create own modules with Ansible?

Answer: Yes, the Ansible allows us to create the modules within it. As it is an open-source tool that majorly runs on Python. This means anyone who has little bit knowledge of programming can create their own modules without any problem within Ansible.

Q17) What’s the best way to generate crypto passwords for the user module?

Answer: The availability of mkpassword utility in Linux is the best option for generating the crypto passwords. For the OS X users who don’t have this utility installed on your system, they can also generate crypto passwords by using Python.

Q18) Name the different components of Ansible.

Answer: Ansible automation is consist of the following elements:

  • Inventories
  • Modules
  • APIs
  • Host
  • Playbooks
  • Cloud
  • Networking

Q19) How can we make content redistributable and reusable?

Answer: In Ansible there are three major ways to reuse files in playbooks which include import and roles.

Q20) Explain the way to access shell environment variables in Ansible.

Answer: For accessing shell environment variables in Ansible users need to use the “env” lookup plugin. There are some codes that you have to write for this. The codes are mentioned below:

  • _ _ _
  • # …
  • vars :

Q21) Is it possible to keep secret data in the playbook?

Answer: Yes, it is possible to keep secret data in your Ansible content with the use of Vault in playbooks. With V mode you have to use some commands to hide sensitive data from others.

Q22) Explain ad-hoc commands.

Answer: The ad-hocs are used to take action on the hosts without writing the playbooks. So, if you have to reboot the hosts in a specific group then there are two ways to do that. You can either create a new playbook or you can simply use the one-off ad-hoc command.

Q23) Explain the term “fact” in Ansible.

Answer: In the Ansible environment, “fact” is the most commonly addressed term. The facts are used by Ansible to get information about the host and store. The Ansible runs the setup modules to generate these facts.

Q24) What is the right way to copy files recursively onto a target host?

Answer: This “copy” module of Ansible has recursive parameters. You can also utilize “synchronize” modules if you need to perform more efficient for a huge number of files. It is important to use commands with “synchronize” modules.

Q25) Explain the meaning of Ansible tasks.

Answer: The Ansible tasks are majorly used to break up bits of configuration policy in little files. These small blocks of code that are used to automate any process.

Q26) Explain the Ansible role and what makes it different from the playbooks?

Answer: The Ansible role is completely another level of abstraction. These are used to organize playbooks. It provides an independent structure and a reusable collection of various things. It includes templates, files, variables, tasks, etc.

Q27) Why Ansible vaults are used?

Answer: The Ansible vaults are used to keep all your secret data safe. It facilitates the encryption of sensitive data but also integrates them into your playbooks. The files can either be entirely encrypted or unencrypted, the vault is implemented with file-level granularity. The Ansible vaults are very user-friendly.

Q28) Explain the features of the Ansible tower.

Answer: The Ansible towers display everything happening in the Ansible environment like inventory status, hosts and other recent activities. It also integrates the notifications about all the necessary updates. The multi-playbook workflow feature of Ansible tower makes it easier to chain all the playbooks. It is also useful for scheduling Ansible jobs.

Q29) How can you connect other devices within Ansible?

Answer: After installing Ansible on the controlling systems, one inventory file is created which particularly explains the connection between other nodes. The SSH protocol can be used to make a connection. If you want to check its connection, then you can use the ping module. The command to check this connection is:  ansible -m ping all

Q30) Does Ansible support AWS?

Answer: There are hundreds of modules present in Ansible that support AWS. It includes:

  • Autoscaling groups
  • CloudFormation
  • Virtual Private Cloud (VPC)
  • Security Groups
  • Relational Database Service (RDS)
  • CloudTrail
  • Elastic Cloud Compute (EC2)

Q31) Which one is not a valid value of state argument of “file” module?

  1. file
  2. absent
  3. folder
  4. link

Answer: Folder

Q32) Which module can be utilized to copy files from a remote machine to a control machine?

  1. ping
  2. fetch
  3. copy
  4. move

Answer: fetch

 Q33) If you do not need any facts from the host, what command would you use?

  1. gather_facts: no
  2. gather_facts: False
  3. both gather_facts: no or gather_facts: False
  4. gather_facts: y

Answer: gather_facts: no

 Q34)Where is Inventory file located by default?

  1. /etc/ansible/hosts
  2. /etc/inventory
  3. /etc/configurations
  4. /etc/ansible

Answer: /etc/ansible/hosts

Q35) What is the default location for Ansible?

Answer:Default location for Ansible modules is /usr/share/ansible

 Q36) What module can be utilized to stop a playbook execution for a specific period?

  1. Sleep
  2. Pause
  3. Stop
  4. Suspend

Answer: Pause

 Q37) Which module will you utilize to create a directory?

  1. File
  2. template
  3. fetch
  4. copy

Answer: File

 Q38) Which module can be used to force a handler to run in between two tasks?

  1. Flush
  2. None of the options
  3. assest
  4. meta

Answer: meta

Q39) Which Ansible module is utilized for managing docker services and containers?

  1. docker_service
  2. docker_login
  3. docker_image
  4. docker

Answer: docker_service

Q40) Ansible has two types of servers. Select the appropriate answer from the given options.

  1. only node
  2. controlling machines and nodes

Answer: controlling machines and nodes

Q41) How to define the number of parallel processes while communicating to remote hosts?

  1. pipelining
  2. Forks
  3. become_method
  4. become

Answer: Forks

 Q42) What is the default forks value in configuration file?

  1. 1
  2. 5
  3. 7
  4. depends upon hosts in the inventory

Answer: 5

 Q43) How can you reduce the number of SSH connections required?

  1. accelerate port
  2. pipelining
  3. forks
  4. become_method

Answer: pipelining

 Q44) Which configuration management is agentless

  • Ansible
  • Puppet
  • chef
  • CFEngine

Answer: Ansible

 Q45) Ansible is generally referred to as what?

  • Infrastructure as code
  • Orchestration Engine
  • Configuration management
  • All the options

Answer: All the options

 Q46) How would you write comments on Jinja2:

  1. {{}}
  2. {##}
  3. {%%}

Answer: {##}

 Q47) What is the web-based interface used to access projects, inventories, job templates and jobs Ansible?

Answer: Ansible Tower Interface

Q48) How to Install Ansible in the Redhat Linux operating system?

Answer:

  • yum install ansible

Once the installation is completed, check the ansible version :

  •  ansible –version

If ansible package is not available in the default yum repositories, we need to manualy download.

 Q49) How to set SSH-based access from Controller to Managed Nodes which is recommended by Ansible?

Answer: It provides passwordless auth to access the managed servers
In Control Server.
Step 1: Create user for ansible useradd -d /home/gangboard -m gangboard passwd gangboard
Step 2: Switch to ansible user
Step 3: su – gangboard
Step 4: Generate ssh key ssh-keygen -t rsa
Step 5: /home/gangboard/.ssh/id_rsa.pub => Public Key is in this file which needs to be copied to nodes ~/.ssh/authorized_keys

Q50) Perform the following setps on all Managed nodes.

Answer:
Step 1: Create user for ansible useradd -d /home/tadmin -m tadmin passwd tadmin
Step 2: Switch to ansible user su – tadmin
Step 3: Create .ssh directory mkdir .ssh
Step 4: Change permission to 700 for .ssh chmod 700 .ssh/
Step 5: Change Ownership to tadmin for .ssh chown tadmin:tadmin .ssh/
Step 6: create an authorized_keys file under .ssh and paste the public key from controller and save it
Step 7: cd .ssh/ , vi authorized_keys
 Step 8: Copy & paste the public key from the Controller server to this file [/home/tadmin/.ssh/id_rsa.pub] Now you able to access the server without a password.

Q51) What is inventory in Ansible and how to update it?

Answer:

  • The inventory files contain a host list of managed nodes, when ansible accessing the client it look into inventory.
  • The default inventory file for Ansible is located under /etc/ansible/hosts
  • This default inventory lookup can be overridden using -i option providingthe custom inventory file

 Example: ansible -i cmdb.inv main.yml Update default Inventoryfile/etc/ansible/hosts (as rootuser) [clients]

  • node1
  • node2

Q52) How to run ansible command? Briefly explain?

Answer:
Running ansible command #ansible all -m ping

  • ansible => Ansible command
  • all       => Specifies the target to run the command.The target could an individual node or group(mentionedininventoryfile)orall(allthenodesintheinventory file). In this case all is used, which means that the command will be executed on all the nodes.
  •  -m     is the option that indicates that a module needs to be executed on remote nodes
  • ping is the name of a module. This module checks the ping status of the remote node. It has no attribute parameter (-a)

Q53) Explain the below output?

Answer:
Expected Outcome of the first command for 4 QUE

node1 | SUCCESS =>
 {
 "changed": false,
"ping":"pong"
 }             
 node2 | SUCCESS =>{ "changed": false, "ping":"pong"
 }

Let’s understand on how to interpret the output
Explanation:

  • node1  – This identified the node on which the task is done
  • SUCCESS  -Give a confirmation that the module was run successfully
  • “changed”: false – ping module doesn’t do any modification on the remote node. It just checks the ping or node ON status. This the reason the changed status “false”.
  • “ping”:” pong” -This a way ping module confirms the ping reply as“pong”.

Note: The output varies from module to module depending on how the module is

Q54) What is ansible-playbook?

Answer: The playbook is a .yml file that contains a piece of code called a module. You can have multiple tasks in a playbook and these tasks would be executed by Ansible. Playbooks have a list of remote hosts, user variables, tasks, handlers inside it.

Q55) How to write playbook, give example?

Answer: Below is the sample playbook:

name: Install Docker and  restart service hosts: webapp
become: true tasks:
name: Install Docker yum:
name: docker state: latest
name: Restart Docker  Service service:
name: docker state: restarted

Q56) which command is used to run an ansible playbook?

Answer: command to run a playbook
 $ ansible-playbook -i hosts main4.yml   

  •  -i- This is an option to specify to ansible to override the default inventory file and the inventory file specified.
  •  main.yml: This is the playbook file

Q57) What is the use of list-task in ansible?

Answer:  list-task: List all the tasks that will be executed when you run a playbook.

Q58) what is the use of –start-at-task in ansible?

Answer: start-at-task option, will start executing the task you specify and subsequent tasks are executed. The tasks above are skipped.

 Q59) What is ansible variables?

Answer:

  • Variables are used to store values that can be later used in the playbook.
  •  Vars: is the tag to define a variable.

Q60) How are nodes,managed by a controlling machine over?

  1. They are managed by SSH and also the location of nodes are specified by controlling machine through inventory.
  2.  You can use ansible-vault to store sensitive information.
  3. True
  4. False

Answer: True

Q61) Why handlers are used in the playbook?

Answer:

  • Handlers are similar to tasks in executing modules. The only difference is that the handlers need to be called explicitly.
  • Handlers will be called only on successful change of the state i.e. when the task has done some changes on remote nodes aka.  state: changed
  • Within tasks, handlers will be called using “notify” tag. Name given in notify should  exactly match  as in the -name tag inside handlers

 Q62) How to define handler in ansible playbook?

Answer:

handlers:
name: Restart Docker Service
service:
name: docker
state: restarted

 Q63) What is ansible roles?

Answer: Ansible roles consists of many playbooks. Roles are a way to group multiple tasks together into one container. These are reusable scripts.

Q64) How to create Ansible roles?

Answer: By using the following command  we can create ansible roles
Ansible-galaxy init <rolename>

Q65) What are the key things required for the playbook?

Answer: Playbook may contains

  • Hosts
  • Variables (Optional)
  • Tasks

Q66) What are the advantages of Ansible?

Answer: Ansible is agentless which means it doesn’t require any node machine to configure. It uses YAML to create playbooks which is easy to understand.

Q67) Explain about handlers in Ansible?

Answer:  If we want to execute tasks whenever something changed in the configuration files then we need to use “notify” in the playbook. For example if we want to restart apache whenever the configuration file changes.

Q68) What is inventory in ansible?

Answer: /etc/ansible/hosts file called as inventory. It contains the group of the server name or IP’s.

Q69) Explain about ansible modules?

Answer:  Ansible modules are building blocks of ansible that are reusable scripts that are used by ansible playbooks.

Q70) How will start the services using ansible?

Answer: ansible    -m service  -a “name= httpd state=stopped” –become

Q71) What is configuration management?

Answer:  Configuration management is a process of continuous deployment and continuous delivery and continuous monitoring of the many servers in less period of time to achieve deliverables.

Q72) How to execute the created roles?

Answer:  —

  • hosts: true
  • role:
  • – apache<rolename>

Q73) How to use existing tasks in Ansible?

Answer: by using  import_tasks:

Q74) How to use ansible-galaxy to download roles?

Answer: ansible-galaxy install username.rolename

Q75) What is ansible jinja2 templates?

Answer: It is a file that contains all dynamic configurations parameters which will be having .j2 extension.

Q76) How to do role duplication and execution?

Answer: using allow_duplicates: true

Q77) What are the role dependencies?

Answer: Role default variables allow you to set the default variables for included or dependencies
Dependencies:

  • Role: tire
  • Role: brake

Q78) How to secure Ansible playbooks?

Answer: We have concept called ansible-vault .which encrypts the YAML files.

Q79) How to encrypt and decrypt Ansible playbooks?

Answer: Using ansible-vault encrypt and ansible-vault decrypt

Q80) How to change the existing password for ansible vault?

Answer: ansible-vault rekey

Q81) How to install Ansible on Linux?

Answer:  First we need to install epel repo and then install ansible

  • Yum install epel-repo
  • Yum install ansible

Q82) Which module copies a dynamically generated file from control machine to target

  1. template
  2. file
  3. fetch
  4. copy

Answer: Template

Q83) How do you define ansible in the configuration management perspective?

Answer: Anything can be deployed/configured/installed by using ansible in the list of servers without even touching the server which actually doesn’t need any clients to be configured in all the server since it operates in ssh mode. That’s why it is called agentless, low overhead configuration management service

Q83) Do u know how to illustrate the working of Ansible ?

Answer: Yes, Ansible should be setup on a dedicated server which contains modules, inventories configured. Inventory contains the list of the target host which we want to connect/deploy/install/configure. That is simply a yaml file contained group name, server details. Modules are predefined in ansible which has the actual implementation definition on the ansible libraries. Host machines i.e target machines are connected via ssh and executes using python interpreter since all the definitions converted into python.

Q84) How do you define ansible is useful in the automation paradigm?

Answer: Automation is a sequence of operation which is done manually by the admin which is not possible over a thousands of server but that has to be managed from some place so ansible server is needed and all the server need not to be configured with some agent which takes operational headache all these can be overcome by the Ansible configuration management.

Q84) Do you know any API reference for Ansible ?

Answer: Yes, Ansible works on Rest API call which can be achieved by using ansible tower. It gives an option to use RBAC which is secured to access the secured ssh credentials

Q85) Will you be able to restart the target machines with Ansible?

Answer: Yes, we can restart the machines since it is OS operations, we have reboot module that has to be added in the tasks of the playbook to restart the machine

Q86) Do you know what are all the features of Ansible beyond automation?

Answer: Yes, It is not only for task automation, we can also perform beyond that. Cloud infrastructure automation can be performed using that, you can deploy the application to servers by using ansible, you can perform configuration management which is the main feature, and you can orchestrate multiple IT environment

Q87) How ansible is executing just by YAML script?

Answer: Actually Ansible is not written in YAML, it has written in python programming and Powershell. So, YAML is getting converted to it that’s how it works

Q88) Do you know ansible cannot be considered as opensource?

Answer: That is completely wrong, Ansible is opensource whereas Redhat Ansible is customized by Redht

Q89) Server requirement for Ansible how will it look like ?

Answer: Here Ansible server should have linux installed and python version should be 2.6 or higher.

Q90) So do you have an option do customize you own ansible modules?

Answer: Yes, Since it is an opensource tool, you have an option to customize it. But the clear requirement is you should be a good programmer so that you can get started to develop your own module for Ansible. You don’t need any extraordinary prior experience to build your own module

Q91) Do you know the other way around to perform ansible operations without writing playbooks ?

Answer: We have an option to write our single task and execute it without even writing playbook that is called ad-hoc commands. Which is like normal Ansible CLI commands which passes required modules and arguments for the modules, and the targeted host groups in a single command.

Q92) Do you know how do we parameterize the arguments required for the module ?

Answer: This can be done in the playbook or roles when you write it, you have to use variables and its value under vars section in playbook. If it is roles, it has to be in the vars folder and main.yaml file.
Example:
vars:

  • myvar1: value
  • myvar2: value

Q93) Will you be able to see the host machine all variables using ansible?

Answer: Yes we have a module called debug module. Either you can write playbook or adhoc commands, both the way it can be achieved.  Pass the arguments as ‘var=hostvars[inventory_hostname] localhost’ this gets the variables of machines

Q94) Could you differentiate Roles and Playbooks?

Answer: Roles are written as a collection which contains tasks, vars, default vars, metadata information, handlers, files all separated in different folder whereas in playbook which contains all in a single file. Roles can be shared with ansible galaxy so that others can easily pull it without any dependency

Q95) Differentiate ask_pass and ask_sudo_pass

Answer: Yes Ask_pass default value is actually no, if you want it to enable explicitly you can set it as True. This enables option to ask password whereas ask_sudo_pass will be prompted when sudo password is required to entered by the user.

Q96) Do you know how do we make use of our ansible script reusable or redistributable ?

Answer: Yes roles is the only way we can use this. Roles ensures that can be distributed or redistributed with the updated content . This contains document which says how to use the roles.

Q97) Do we hav option to copy a file from my ansible server to all server ?

Answer: Yes, we have option to copy files from ansible servers to all the servers. We have file module which does that. You can also copy files with changing or without changing permissions, owners, groups etc.

Q98) How can u encrypt ansible passwords or any data ?

Answer: We have ansible vault which protects all the confidential information which is needs to be protected from the end user.

Q99) How will you ensure the targeted server connection is established ?

Answer: We can use ping module which tries to ping all the servers in the inventory files. This will give ‘pong’ as response if the server is pingable. The ad-hoc commands can be used to test whether the servers are reachable with ansible server or not. The syntax of the commands is
‘ansible -m ping <groupname>’

Q100) What are playbooks in ansible ?

Answer: Playbooks are the scripts that we use in Ansible. They are used as building blocks that you can use to execute on remote machine. The scripts will contain the instructions that needs to be executed on the remote machines. This script follows a yaml format so you have to very careful with the indentation.

Q101) What are ad-hoc commands ?

Answer: Ad-hoc commands in ansible is another way of executing commands on remote machines. They are your one time commands that will not be saved for future use. The other way that you can execute commands on remote machines is by writing a playbook.

Q102) What is an inventory file ?

Answer: Inventory file is the file that will be used by the playbooks to identify the IP addresses of the remote machines to execute the playbooks. This file is also known as the host file and will be available in “/etc/ansible/hosts” location. Whenever you want yo execute a playbook you will need to provide the IP addresses in the inventory file.

Q103) What is ansible tower ?

Answer: Ansible tower is the UI version of Ansible. Ansible tower provides an web user interface that you can use to execute the playbooks. Ansible tower makes it easier to use ansible for all the IT needs.

Q104) What are roles in ansible ?

Answer: Roles are the advanced way to execute your playbooks on remote machines. Instead of writing one large playbook and making it very complicated, you can divide the playbook as per their section (Target, variables, tasks, handlers) by using roles and make the executing easier. By using roles, it becomes easier to manage very large playbooks. Roles will be present in “/etc/ansible” location. You can use “ansible galaxy” tool to create roles in ansible.

Q105) What is your understanding about Ansible ?

Answer: Ansible is a widely used IT configuration management tool . The best part of ansible is it is Open source so License is required and second one is it is Agent less , means we not need to Install any software on client machine to manage it .

Q106) What is Ansible Host and Node ?

Answer: Ansible has two part one is called Node machine and one is called Host Machine. The Node machine is here the ansible Server is installed and Host Machine is which is managed my Ansible Node.

Q107) How Ansible Communicate with its host Machine?

Answer: Ansible communicates with all its host machine using SSK key. We need to create an SSH Key using ssh-keygen command on Ansible Node machine and copy to all host machines.

Q108) What is Ansible Tower?

Answer: Ansible tower is commercial products from Redhat . It is used to simplify the job of ansible automation. We can also has lot of options like monitoring

Q109) What is Configuration Management (CM) Practices?

Answer: Configuration Management is the practice of managi8ng the complete Infrastructure as a code ( IAC), it helps to automate the provisioning, deprovision, update, manage, deprovisioning of infrastructure which include OS, Application, update as an code.The organization is using Ansible , Terraform likes tool for their CM.

Q110) What are the  basic terminologies used in  Ansible.

Answer: The most basic terminology used in Ansible are

  • Controller Machine: It is the main controller machine, which manages all the host
  • Playbook: An YAML script, which contains the tasks
  • Task: Task is the single piece of work like install http
  • Inventory: The server can be gopura together know as inventory
  • Module: It is an executable set of tasks.
  • Role: An Ansible role is a pre-configured way forgetting organize the  playbooks

Q111) Please define what is Ansible Galaxy?

Answer: Ansible Galaxy is the website , where we can share all the ansible roles

Q112) How can you install Ansible on Amazon EC2 instance?

Answer: Ansible can be installed on Amazon EC2 Instance using the Yum Install command.

Q113) How can you install Ansible on Amazon EC2 instance?

Answer: Ansible can be installed on Amazon EC2 Instance using sudo pip  Install ansible command.

Q114) How can you take backup of  configuration in Ansible?

Answer: Use copy  module in Ansible we can backup the file to remote locations

Social Share:

0 responses on "Ansible Interview Questions and Answers"

Leave a Message

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