LearnThatStack Ace your next interview
DevOps
Ansible.
27 Qs 4 free
Change topic Change
Drill · questions

All questions

of 27
Beginner 3
01

Explain the difference between Ansible Playbooks, Plays, and Tasks.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
  • Playbook: A YAML file containing one or more plays that define automation workflows
  • Play: A section within a playbook that maps hosts to tasks and defines how tasks should be executed
  • Task: Individual units of work that call Ansible modules to perform specific actions
# Playbook
- name: Web server setup          # Play 1
  hosts: webservers
  tasks:
    - name: Install Apache        # Task 1
      yum:
        name: httpd
        state: present
    - name: Start Apache          # Task 2
      service:
        name: httpd
        state: started
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

02

What is an Ansible Inventory and what are the different types?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Ansible Inventory defines the hosts and groups that Ansible manages. It specifies which machines your playbooks will run against.

Static Inventory (INI format):

[webservers]
web1.example.com
web2.example.com

[databases]
db1.example.com ansible_host=192.168.1.100

[production:children]
webservers
databases

Static Inventory (YAML format):

all:
  children:
    webservers:
      hosts:
        web1.example.com:
        web2.example.com:
    databases:
      hosts:
        db1.example.com:
          ansible_host: 192.168.1.100

Dynamic Inventory:

  • Scripts that generate inventory from external sources (AWS, Azure, GCP)
  • Returns JSON format with host and group information
  • Useful for cloud environments where hosts change frequently
  • Can be written in any language that outputs proper JSON
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

03

What are Ansible Facts and how do you use them?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Ansible Facts are system information automatically collected from managed nodes when a playbook runs. They include details about hardware, OS, network configuration, and installed software.

Accessing facts:

- name: Display OS information
  debug:
    msg: "This host runs {{ ansible_distribution }} {{ ansible_distribution_version }}"
- name: Conditional based on facts
  yum:
    name: httpd
    state: present
  when: ansible_os_family == "RedHat"

Custom facts:

- name: Set custom fact
  set_fact:
    custom_variable: "custom_value"
- name: Gather facts manually
  setup:
- name: Disable fact gathering
  hosts: webservers
  gather_facts: false
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

Intermediate 14
04

How do you handle sensitive data like passwords in Ansible?

Intermediate ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Ansible Vault is the primary method for encrypting sensitive data like passwords, API keys, and certificates.

Basic Vault operations:

# Encrypt a file
ansible-vault encrypt secrets.yml

# Decrypt a file
ansible-vault decrypt secrets.yml

# Edit encrypted file
ansible-vault edit secrets.yml

# Run playbook with vault password
ansible-playbook site.yml --ask-vault-pass

# Use vault password file
ansible-playbook site.yml --vault-password-file .vault_pass

Encrypting specific variables:

# vars.yml
username: john
password: !vault |
  $ANSIBLE_VAULT;1.1;AES256
  66386439653762356265343432393730...

Best practices:

  • Store vault password in a file with restricted permissions (chmod 600)
  • Use separate vault files for different environments
  • Encrypt only sensitive variables, not entire playbooks
  • Use no_log: true in tasks handling sensitive data
  • Never commit vault passwords to version control
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

05

Explain Ansible Roles and their directory structure.

Part of Pro
06

What are Ansible Variables and what is the order of precedence?

Part of Pro
07

How do you implement conditionals in Ansible?

Part of Pro
08

Explain Ansible Handlers and when to use them.

Part of Pro
09

How do you implement loops in Ansible?

Part of Pro
10

Explain Ansible Galaxy and how to create custom roles.

Part of Pro
11

How do you implement error handling in Ansible?

Part of Pro
12

What are Ansible Collections and how do they differ from roles?

Part of Pro
13

How do you manage different environments (dev, staging, prod) in Ansible?

Part of Pro
14

How do you test Ansible playbooks and roles?

Part of Pro
15

Explain Ansible's idempotency and how to ensure it in custom tasks.

Part of Pro
16

How do you handle Ansible playbook debugging and troubleshooting?

Part of Pro
17

How do you monitor and log Ansible operations?

Part of Pro
Expert 10
18

How do you optimize Ansible performance for large infrastructures?

Part of Pro
19

Explain Ansible Vault and advanced encryption techniques.

Part of Pro
20

How do you create and use custom Ansible modules?

Part of Pro
21

What are Ansible plugins and how do you create them?

Part of Pro
22

How do you implement rolling deployments with Ansible?

Part of Pro
23

How do you manage secrets and integrate with external secret management systems?

Part of Pro
24

What are Ansible callbacks and how do you create custom ones?

Part of Pro
25

How do you implement infrastructure as code with Ansible for cloud platforms?

Part of Pro
26

How do you implement Ansible in CI/CD pipelines?

Part of Pro
27

What are some Ansible security best practices?

Part of Pro

No matches

Try a different filter or search term.

Pro · $10/mo

23 of 27 Ansible answers are gated.

Full answers, code samples, AI explanations - simpler, deeper, or as an interactive diagram. Cancel anytime.

  • Full answers + code
  • AI explain - simpler, deeper, or visualized
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

JAM

JavaScript, APIs, and Markup

Serverless on AWS

Serverless Architecture on AWS

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Flutter Mobile

Flutter Cross-Platform Mobile Development

Cross-cutting topics 44 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

Web3 / Ethereum

Solidity, Ethereum, Hardhat, Foundry

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git
Big-O & Complexity Analysis Arrays, Strings & Hash Tables Linked Lists, Stacks & Queues Trees, BSTs & Heaps Graphs Sorting, Searching & Recursion Operating Systems Concurrency & Multithreading Networking for Developers Git & Version Control API Design 45 Distributed Systems Fundamentals 34

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.


Cross-cutting topics 45 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.