Test Your Ansible Knowledge: Ansible Interview Questions and Answer

  1. What is Configuration Management?
  2. List a few available configuration management tools.
  3. What is Ansible? List some of major advantages of using Ansible.
  4. Write down the data flow of Ansible.
  5. What is the major difference between scripting langugage and Ansible?
  6. What do you understand by the term IaC?
  7. What is idempotency? Is it a useful feature of Ansible?
  8. List down the most commonly used Ansible terms in Ansible ecosystem.
  9. What are the pre-requisites to install Ansible?
  10. Perform Ansible installation and configuration setup on CentOS and Debian.
  11. Execute “ansinble –version” to check installed Ansible version.
  12. What is the precedence order of Ansible to identify valid Ansible Configuration File?
  13. Perform password-based and key-based authentication setup for two different Managed Nodes.
  14. Perform a ping test on Managed Node from Ansible Controller Node to confirm Ansible Communication.
  15. What are modules? How many type of modules are three in Ansible?
  16. Execute a command to list down all of the available “Core Modules” in Ansible.
  17. Create a user named “yogesh” with uid “9876” and shell “/bin/bash” on Managed Nodes using Ad-hoc Ansible execution.
  18. Install a package named “telnet or talk or git” on Managed Nodes using Ad-hoc Ansible execution.
  19. Create a simple script to create a file and directory and execute it on Managed Nodes using Ansible Ad-hoc execution with appropriate Ansible Module.
  20. What do you understand by Privilege Escalation in Ansible?
  21. What is YAML language? What are the three simple rules to remember about YAML in Ansible?
  22. What are Playbooks? List the major portions used in any Playbook.
  23. What do you understand by Play?
  24. What are tasks?
  25. Create a Playbook to install and configure “webserver, I.e., httpd/apache”. Use Package, File, and Service Modules. Make sure to get output as “This is my First – Playbook in Ansible” on browser.
  26. Create a Playbook for “motd file” and use different variables to configure the file.
  27. What is the purpose of Debug Module in Ansible?
  28. What is the importance of Register variable in Ansible?
  29. Create another “motd file” and use different facts generated by Ansible to configure the file.
  30. Create another “motd file” and use both user-defined variables and Facts to configure the file.
  31. Create a user named “yogeshraheja” using Ansible Statements with conditions CentOS is having version 7.x and Ubuntu is having version 16.x.
  32. Create a playbook to install “mysql” server and all its dependencies like php, nginx using Ansible loops.
  33. What is the special purpose of notify in Ansible?
  34. Use the Handler section inside the Playbook create earlier in Chapter 5, Ansible Playbooks (under Tast You Knowledge section) for “webserver i.e httpd/apache” and run it after changing “file” module with “this is my First Playbook with Handler Section”.
  35. What are Ansible Roles and why are they Important?
  36. What is a command to create a base directory structure for Ansible Roles?
  37. Create an Ansible Roles for “Webserver” server using tasks, variables, facts, and handlers.
  38. How can one define dependencies in Ansible Roles?
  39. What is Ansible galaxy?
  40. Create your Ansible Galaxy Account.
  41. Login and explore Ansible Galaxy site – https://galaxy.ansible.com/
  42. Search, install, and use Ansible Role named “docker-test” from Ansible Galaxy.
  43. Create and run a Playbook with two different tasks using Copy and Fetch modules.
  44. What do you understand by fork and serial attributes in Ansible?
  45. Create and run a Playbook to ignore failed operation errors and proceed further with tasks operations.
  46. What is Ansible Tower?
  47. Perform an installation and configuration of Ansible Tower with free 10 node offerings given by RedHat.
  48. Log in and explore Ansible Tower.
Rajesh Kumar
Follow me