Skip to main content

Ansible - FAQs

1. Ansible Basics

  1. What is Ansible, and how does it differ from other configuration management tools like Puppet or Chef?

  2. What language does Ansible use to define automation tasks?

  3. What is an Ansible Playbook?

  4. What is the difference between an ad-hoc command and a playbook?

  5. What are the main components of Ansible architecture?

  6. What is an inventory file in Ansible?

  7. What is the default inventory location in Ansible?

  8. How does Ansible connect to remote machines?

  9. Can Ansible work without an agent?

  10. What is the purpose of ansible.cfg?


2. Inventory & Configuration

  1. What are the types of inventories supported by Ansible?

  2. How do you define host groups in an inventory file?

  3. What are dynamic inventories, and when would you use them?

  4. How can you manage different environments (e.g., dev, test, prod) in Ansible?

  5. What are inventory variables and host variables?

  6. How do you use the --limit flag in Ansible commands?

  7. How do you override variables for a specific host?

  8. What happens if the same variable is defined in multiple places?


3. Playbooks & Roles

  1. What is the structure of an Ansible playbook?

  2. What are plays, tasks, and handlers?

  3. What are roles in Ansible? Why are they used?

  4. How do you include or import another playbook?

  5. How can you reuse code within playbooks?

  6. What is the difference between include_tasks and import_tasks?

  7. How can you trigger a handler manually?

  8. What is the use of tags in playbooks?

  9. How do you ensure a task runs only once even if you target multiple hosts?

  10. How do you debug playbooks?


4. Variables & Templates

  1. What are Ansible variables, and how are they defined?

  2. What is variable precedence in Ansible?

  3. What are facts in Ansible?

  4. How can you gather facts from a remote node?

  5. How do you disable fact gathering?

  6. What are Jinja2 templates, and where are they used?

  7. How can you use loops in Ansible?

  8. What are filters in Jinja2? Give examples.

  9. How do you use conditional statements in Ansible?

  10. How can you encrypt variables?


5. Ansible Vault

  1. What is Ansible Vault used for?

  2. How do you create an encrypted file using Vault?

  3. How do you edit an existing Vault file?

  4. How can you encrypt a specific variable within a playbook?

  5. How do you use a Vault password file?

  6. Can you use multiple Vault passwords?

  7. How do you decrypt a Vault file temporarily during runtime?


6. Modules

  1. What are Ansible modules?

  2. What are some commonly used modules?

  3. What is the difference between command and shell modules?

  4. How can you check available modules in Ansible?

  5. How do you create a custom module?

  6. What module would you use to copy files from control node to managed nodes?

  7. What is the raw module used for?

  8. How do you use with_items or loops with modules?

  9. How do you test a module?


7. Error Handling & Debugging

  1. How can you handle errors in Ansible playbooks?

  2. What does ignore_errors do?

  3. How can you skip a task conditionally?

  4. What is failed_when used for?

  5. What is changed_when used for?

  6. How do you print debug messages during execution?

  7. How can you run playbooks in check mode?

  8. How do you test changes without applying them?


8. Advanced Topics

  1. What is Ansible Galaxy?

  2. How do you install a role from Ansible Galaxy?

  3. What are custom facts, and how are they defined?

  4. What is an Ansible Collection?

  5. How do you run a playbook on a specific subset of hosts?

  6. What is delegate_to used for?

  7. How can you run tasks asynchronously?

  8. How can you execute tasks in parallel?

  9. What are “Handlers” and how do they differ from “Tasks”?

  10. What is ansible-pull and when do you use it?


9. Real-World / DevOps Scenarios

  1. How would you deploy an application using Ansible and Jenkins together?

  2. How do you integrate Ansible with Azure DevOps pipelines?

  3. How can you use Ansible to manage Docker containers or Kubernetes clusters?

  4. How can Ansible help in provisioning infrastructure (IaC)?

  5. How do you ensure idempotency in playbooks?

  6. How would you perform a zero-downtime deployment using Ansible?

  7. How do you rollback a failed deployment?

  8. How can you orchestrate multi-tier application deployments?

  9. Have you used Ansible for patch management? Explain.

  10. How can you use Ansible for security compliance automation?


10. Performance & Best Practices

  1. How do you optimize Ansible playbook performance?

  2. What are some best practices when writing Ansible roles?

  3. What are callback plugins in Ansible?

  4. How do you manage secrets in large environments securely?

  5. How do you test your playbooks before deploying to production?

  6. How do you structure a large Ansible project?

  7. What is the difference between serial and max_fail_percentage?

  8. How can you reuse role dependencies efficiently?

 

Comments

Popular posts from this blog

AKS Architecture - High-Level Workflow

High-Level AKS Workflow User/DevOps Engineer interaction You use kubectl , Azure CLI, Terraform, or the Azure Portal to submit a request (e.g., deploy a pod, scale replicas, expose a service). The request goes to the Kubernetes API Server (running in the AKS control plane). Control Plane Processing API Server validates the request and stores the desired state in etcd (the cluster database). Scheduler checks for available resources (CPU, memory, taints, affinities) across worker nodes and decides where to place the pod. Controller Manager ensures the cluster continuously matches the desired state. Example: If you ask for 5 replicas but only 3 exist, it will create 2 more. Worker Node Execution The Kubelet on the chosen worker node receives instructions from the API server. Container Runtime (containerd) pulls the required container image (from ACR, Docker Hub, etc.) and runs the container inside a pod . Kube-proxy updates networking rules...

AKS Architecture Overview

 AKS is a managed Kubernetes service in Azure where Microsoft manages the control plane and you (the customer) manage the worker nodes and workloads . At a high level, it consists of: Control Plane (Master Components) – managed by Azure. Worker Nodes (Agent Nodes) – managed by you (inside your subscription). Supporting Azure Resources – networking, storage, monitoring, identity, etc. 🔹 1. Control Plane (Managed by Azure) This is the brain of the cluster, hosted and managed by Azure. You don’t pay directly for the control plane; it’s included in the service. Key components: API Server – entry point for kubectl, Azure CLI, and Azure portal requests. etcd – distributed key-value store to keep cluster state (pods, secrets, config, etc.). Scheduler – places pods on the right worker nodes based on resources/constraints. Controller Manager – ensures the desired state matches actual state (e.g., replicas). Cloud Controller Manager – integrates Kub...

Top 20 Docker FAQS

  Top 20 Docker Interview FAQs What is Docker, and how is it different from a virtual machine? Explain the architecture of Docker (Client, Daemon, Images, Containers, Registries). What is the difference between a Docker image and a Docker container? How do you create a Docker image? What are best practices for writing a Dockerfile? What is the difference between CMD and ENTRYPOINT in a Dockerfile? What are Docker volumes, and how do they differ from bind mounts? How do you persist data in Docker containers? What is the difference between Docker Compose and Docker Swarm? How does Docker handle networking? Explain different network drivers (bridge, host, overlay). How do you share environment variables and secrets in Docker containers securely? What are multi-stage builds in Docker, and why are they useful? How do you optimize the size of a Docker image? What happens when you run docker run internally? How do you troubleshoot a failing Docke...