Ansible Automation Cheat Sheet 2026

The 30 highest-yield Ansible Automation facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.

50 questions
90 min time limit
70% to pass
  1. What language is the default in which Ansible playbooks are written? YAML format
  2. A playbook needs to iterate over a list of users and create a home directory for each. Which Ansible construct is most appropriate? Using with_items or loop with the user module
  3. When using Ansible with 'serial' execution (rolling updates), when do handlers run? At the end of each serial batch, not at the very end of the entire play
  4. Within an Ansible Collection's directory structure, where should custom modules be placed? plugins/modules/
  5. Which command installs all roles and collections listed in a requirements.yml file? ansible-galaxy install -r requirements.yml
  6. Which Ansible feature allows you to test variable values before a play runs, preventing misconfigured deployments? pre_tasks with assert
  7. Under HIPAA's Technical Safeguard requirements, which Ansible practice best satisfies the 'audit controls' standard? Storing playbook output in an immutable, timestamped job log in Tower/AWX
  8. What is the effect of setting `strategy: free` in a play? Each host executes tasks as fast as it can without waiting for others
  9. How do you register a task result and use it in a subsequent conditional? Use `register` to store the result and `when` to reference the registered variable
  10. What is the difference between 'include_tasks' and 'import_tasks' in Ansible? include_tasks is dynamic (runtime), import_tasks is static (parse time)
  11. What does `ansible-lint` rule `no-changed-when` enforce? Tasks using `shell` or `command` must define `changed_when`
  12. What is the role of `uri` module in post-deployment quality assurance? Sends HTTP requests to verify endpoints are reachable and returning expected responses
  13. What is the purpose of Ansible Tower's (AWX) workflow templates? Chain multiple job templates with conditional logic
  14. Which practice reduces the risk of accidental production changes when maintaining separate dev and prod inventories? Requiring explicit `--limit` to target production hosts
  15. What keyword is used in an inventory file to define variables that apply to all hosts in a group? [groupname:vars]
  16. Which command builds an Ansible Collection into a distributable .tar.gz archive? ansible-galaxy collection build
  17. What does `any_errors_fatal: true` do in a play? Stops the entire play if any host fails
  18. Which conditional syntax correctly checks if a variable is defined in an Ansible task? when: my_var is defined
  19. What does the Ansible documentation recommend as the primary method to test a playbook's changes without applying them? ansible-playbook --check
  20. What host pattern would you use to target all hosts in both 'webservers' and 'dbservers' groups? webservers:dbservers
  21. Which ansible.cfg setting disables SSH host key checking? host_key_checking = False
  22. In a YAML inventory file, how do you define a host with a variable? hosts:\n server1:\n ansible_user: admin
  23. Where must Ansible handlers be defined within a playbook? In a 'handlers' section at the play level, separate from the 'tasks' section
  24. How does a Ansible Automation professional communicate risks to stakeholders? By presenting risks clearly with context, potential impacts, and recommended actions
  25. What is the best-practice way to ensure an Ansible execution environment is reproducible across different control nodes? Use an execution environment image built with ansible-builder
  26. What is an Ansible Collection? A packaged bundle of roles, modules, plugins, and playbooks distributed as a single unit
  27. How has digital technology transformed Ansible Automation practice? It has enhanced data collection, analysis, communication, and operational efficiency
  28. Which ansible-playbook flag runs only tasks that are tagged with a specific tag? --tags
  29. What is the risk of disabling SSH host key checking (`ANSIBLE_HOST_KEY_CHECKING=False`) in production? Vulnerability to man-in-the-middle attacks
  30. Which keyword forces a task to run only once regardless of how many hosts are targeted? run_once
Was this helpful?