1. What is Ansible primarily used for?
A) Web development
B) Configuration management and automation
C) Database design
D) Graphic design
Answer: B
2. Ansible is developed by which company?
A) Google
B) Microsoft
C) Red Hat
D) Amazon
Answer: C
3. What language are Ansible playbooks written in?
A) JSON
B) XML
C) YAML
D) Python
Answer: C
4. What is the default communication protocol used by Ansible?
A) FTP
B) SSH
C) HTTP
D) SNMP
Answer: B
5. What file defines the list of managed hosts?
A) hosts.txt
B) inventory file
C) server.yml
D) config.ini
Answer: B
6. What command is used to test connectivity?
A) ansible-test
B) ansible check
C) ansible all -m ping
D) ansible ping
Answer: C
7. Which command runs a playbook?
A) ansible-play
B) ansible-run
C) ansible-playbook
D) playbook-run
Answer: C
8. Ansible is:
A) Agent-based
B) Agentless
C) Cloud-only
D) Windows-only
Answer: B
9. What does YAML stand for?
A) Yet Another Markup Language
B) YAML Ain’t Markup Language
C) Your Automated Machine Language
D) None
Answer: B
10. Which file stores Ansible configuration settings?
A) ansible.conf
B) ansible.cfg
C) config.yml
D) ansible.ini
Answer: B
11. What are reusable automation units in Ansible called?
A) Tasks
B) Modules
C) Plugins
D) Templates
Answer: B
12. Which module copies files to remote hosts?
A) file
B) copy
C) move
D) fetch
Answer: B
13. What is a playbook?
A) A Python script
B) A YAML file with automation tasks
C) A shell script
D) A log file
Answer: B
14. Which keyword defines tasks in a playbook?
A) steps
B) commands
C) tasks
D) actions
Answer: C
15. Which module installs packages on RHEL/CentOS?
A) apt
B) yum
C) pkg
D) install
Answer: B
16. Which module installs packages on Ubuntu?
A) apt
B) yum
C) rpm
D) dnf
Answer: A
17. What is used to organize playbooks into reusable components?
A) Groups
B) Roles
C) Clusters
D) Nodes
Answer: B
18. Which command checks syntax of a playbook?
A) ansible-check
B) ansible-playbook –syntax-check
C) ansible validate
D) ansible-play –check
Answer: B
19. Variables in Ansible are defined using:
A) $var
B) @var
C) {{ var }}
D) %var%
Answer: C
20. Which module manages services?
A) service
B) daemon
C) process
D) system
Answer: A
21. Default inventory file location?
A) /etc/ansible/hosts
B) /etc/hosts
C) /ansible/hosts
D) /var/ansible/hosts
Answer: A
22. What is Ansible Galaxy?
A) Monitoring tool
B) Package manager
C) Community role repository
D) Cloud service
Answer: C
23. Which module gathers system information?
A) facts
B) setup
C) gather
D) info
Answer: B
24. What are “facts” in Ansible?
A) Errors
B) Logs
C) System information collected from hosts
D) Variables defined by user
Answer: C
25. Which keyword is used to define variables?
A) vars
B) variables
C) define
D) set
Answer: A
26. What does “become” do?
A) Switch user privileges
B) Install packages
C) Create files
D) Define variables
Answer: A
27. Which module manages users?
A) account
B) user
C) adduser
D) login
Answer: B
28. Which file format does Ansible primarily use?
A) XML
B) JSON
C) YAML
D) CSV
Answer: C
29. Ansible was originally created by?
A) Red Hat
B) Puppet Labs
C) Michael DeHaan
D) Google
Answer: C
30. Ansible was later acquired by?
A) Amazon
B) Microsoft
C) Red Hat
D) IBM
Answer: C
31. What command lists inventory hosts?
A) ansible list
B) ansible-inventory –list
C) ansible hosts
D) ansible-show
Answer: B
32. Which keyword defines the target hosts?
A) servers
B) hosts
C) machines
D) nodes
Answer: B
33. Which symbol starts a YAML list?
A) *
B) –
C) #
D) &
Answer: B
34. What does idempotent mean?
A) Runs once
B) Always changes system
C) Produces same result if run multiple times
D) Fails twice
Answer: C
35. Ansible Tower is now called?
A) Automation Hub
B) AWX
C) Ansible Enterprise
D) Automation Platform
Answer: D
36. Which command runs an ad-hoc command?
A) ansible
B) ansible-playbook
C) ansible-run
D) ansible-cmd
Answer: A
37. Which module creates directories?
A) mkdir
B) directory
C) file
D) create
Answer: C
38. What indentation is recommended in YAML?
A) 1 space
B) 2 spaces
C) Tabs
D) 8 spaces
Answer: B
39. Ansible control node must run on:
A) Windows only
B) Linux/macOS
C) Android
D) Router OS
Answer: B
40. Which module fetches files from remote hosts?
A) copy
B) file
C) fetch
D) transfer
Answer: C
41. What keyword is used for conditional tasks?
A) if
B) when
C) condition
D) check
Answer: B
42. Which module runs shell commands?
A) run
B) command
C) execute
D) shell
Answer: D
43. Ansible uses which port for SSH?
A) 21
B) 22
C) 80
D) 443
Answer: B
44. Which company owns Ansible now?
A) Google
B) Red Hat
C) Microsoft
D) Oracle
Answer: B
45. What is a handler?
A) Error message
B) Special task triggered by notify
C) Module
D) Plugin
Answer: B
46. What command shows version?
A) ansible –version
B) ansible version
C) ansible -v
D) ansible-show
Answer: A
47. Which module manages cron jobs?
A) cronjob
B) scheduler
C) cron
D) task
Answer: C
48. Variables inside templates use?
A) [[ var ]]
B) {{ var }}
C) (var)
D) <var>
Answer: B
49. Which command runs playbook in check mode?
A) ansible-playbook –test
B) ansible-playbook –check
C) ansible-playbook –dry
D) ansible-playbook –verify
Answer: B
50. What is Ansible Galaxy used for?
A) Server monitoring
B) Sharing roles
C) Managing SSH keys
D) Logging
Answer: B
Conclusion
This 50-question beginner Ansible quiz is a great starting point for anyone beginning their automation journey with Ansible. If you were able to score 35+ correct answers, you already have a solid understanding of core concepts like inventory files, playbooks, modules, YAML syntax, variables, and ad-hoc commands.
If some questions were challenging that’s completely normal. Learning infrastructure automation takes practice. The key topics you should feel comfortable with after this quiz include:
- How Ansible works (agentless architecture over SSH)
- Writing basic YAML playbooks
- Using common modules like
copy,file,service, andyum/apt - Understanding inventory structure
- Working with variables and conditionals
- Basic troubleshooting and syntax validation
To improve further, you can:
- Practice writing small playbooks in a lab environment
- Explore roles and directory structures
- Learn about Ansible Galaxy for reusable roles
- Try running playbooks in check mode to understand idempotency
Automation is one of the most in-demand DevOps skills today, and mastering Ansible is a powerful step toward becoming a confident automation engineer.
Keep practicing, keep automating and try our next Intermediate Ansible Quiz to level up!



