Why is passwordless authentication a prerequisite for Ansible?
Without passwordless setup Ansible would require manual passwords/keys for each managed node, blocking unattended automation; passwordless SSH lets the control node run commands without prompts.
What two approaches were shown to establish passwordless access?
Either provide a password once for initial connections or use SSH key-based authentication (copying the public key to target machines, e.g., via ssh-copy-id).
What is stored in an Ansible inventory file and what formats are supported?
Inventory lists managed hosts with connection details (usernames/IPs). It can be written in INI (commonly used) or YAML; a default hosts file under /etc/ansible/ is also supported.
How do groups in the inventory help manage servers?
Grouping servers (e.g., app, db) lets you target operations to a role set instead of individual hosts, simplifying updates and role-specific tasks.
When should you use ad hoc commands versus playbooks?
Use ad hoc commands for quick, one-off tasks or connectivity checks (e.g., ping). Use playbooks for multi-step, reusable, version-controlled orchestration and complex setups.