1. Ansible Basics
-
What is Ansible, and how does it differ from other configuration management tools like Puppet or Chef?
-
What language does Ansible use to define automation tasks?
-
What is an Ansible Playbook?
-
What is the difference between an ad-hoc command and a playbook?
-
What are the main components of Ansible architecture?
-
What is an inventory file in Ansible?
-
What is the default inventory location in Ansible?
-
How does Ansible connect to remote machines?
-
Can Ansible work without an agent?
-
What is the purpose of
ansible.cfg?
2. Inventory & Configuration
-
What are the types of inventories supported by Ansible?
-
How do you define host groups in an inventory file?
-
What are dynamic inventories, and when would you use them?
-
How can you manage different environments (e.g., dev, test, prod) in Ansible?
-
What are inventory variables and host variables?
-
How do you use the
--limitflag in Ansible commands? -
How do you override variables for a specific host?
-
What happens if the same variable is defined in multiple places?
3. Playbooks & Roles
-
What is the structure of an Ansible playbook?
-
What are plays, tasks, and handlers?
-
What are roles in Ansible? Why are they used?
-
How do you include or import another playbook?
-
How can you reuse code within playbooks?
-
What is the difference between
include_tasksandimport_tasks? -
How can you trigger a handler manually?
-
What is the use of
tagsin playbooks? -
How do you ensure a task runs only once even if you target multiple hosts?
-
How do you debug playbooks?
4. Variables & Templates
-
What are Ansible variables, and how are they defined?
-
What is variable precedence in Ansible?
-
What are facts in Ansible?
-
How can you gather facts from a remote node?
-
How do you disable fact gathering?
-
What are Jinja2 templates, and where are they used?
-
How can you use loops in Ansible?
-
What are filters in Jinja2? Give examples.
-
How do you use conditional statements in Ansible?
-
How can you encrypt variables?
5. Ansible Vault
-
What is Ansible Vault used for?
-
How do you create an encrypted file using Vault?
-
How do you edit an existing Vault file?
-
How can you encrypt a specific variable within a playbook?
-
How do you use a Vault password file?
-
Can you use multiple Vault passwords?
-
How do you decrypt a Vault file temporarily during runtime?
6. Modules
-
What are Ansible modules?
-
What are some commonly used modules?
-
What is the difference between
commandandshellmodules? -
How can you check available modules in Ansible?
-
How do you create a custom module?
-
What module would you use to copy files from control node to managed nodes?
-
What is the
rawmodule used for? -
How do you use
with_itemsor loops with modules? -
How do you test a module?
7. Error Handling & Debugging
-
How can you handle errors in Ansible playbooks?
-
What does
ignore_errorsdo? -
How can you skip a task conditionally?
-
What is
failed_whenused for? -
What is
changed_whenused for? -
How do you print debug messages during execution?
-
How can you run playbooks in check mode?
-
How do you test changes without applying them?
8. Advanced Topics
-
What is Ansible Galaxy?
-
How do you install a role from Ansible Galaxy?
-
What are custom facts, and how are they defined?
-
What is an Ansible Collection?
-
How do you run a playbook on a specific subset of hosts?
-
What is
delegate_toused for? -
How can you run tasks asynchronously?
-
How can you execute tasks in parallel?
-
What are “Handlers” and how do they differ from “Tasks”?
-
What is
ansible-pulland when do you use it?
9. Real-World / DevOps Scenarios
-
How would you deploy an application using Ansible and Jenkins together?
-
How do you integrate Ansible with Azure DevOps pipelines?
-
How can you use Ansible to manage Docker containers or Kubernetes clusters?
-
How can Ansible help in provisioning infrastructure (IaC)?
-
How do you ensure idempotency in playbooks?
-
How would you perform a zero-downtime deployment using Ansible?
-
How do you rollback a failed deployment?
-
How can you orchestrate multi-tier application deployments?
-
Have you used Ansible for patch management? Explain.
-
How can you use Ansible for security compliance automation?
10. Performance & Best Practices
-
How do you optimize Ansible playbook performance?
-
What are some best practices when writing Ansible roles?
-
What are callback plugins in Ansible?
-
How do you manage secrets in large environments securely?
-
How do you test your playbooks before deploying to production?
-
How do you structure a large Ansible project?
-
What is the difference between
serialandmax_fail_percentage? -
How can you reuse role dependencies efficiently?
Comments
Post a Comment