solution 2025
What is a task? - correct answer ✔the application of a module to perform a
specific unit of work
What is a play? - correct answer ✔A sequence of tasks to be applied, in
order, to one or more hosts selected from your inventory.
What is a playbook? - correct answer ✔A text file containing a list of one or
more plays to run in a specific order.
How to check syntax of ansible playbook? - correct answer ✔ansible-
playbook --syntax-check webserver.yml
How to execute a dry run of a playbook? - correct answer ✔ansible-playbook
-C webserver.yml
How to set a remote user? - correct answer ✔remote_user: remoteuser
What are valid Ansible variable names? - correct answer ✔letters, numbers,
and underscores. Variables must start with a letter.
web_server, file1
Preferred way to define variables? - correct answer ✔define variables for
hosts and host groups in two directories: group_vars and host_vars
How to define extra variables to override the defined value for a variable for a
one-off run of a playbook? - correct answer ✔ansible-playbook main.yml -e
"package=apache"
How to create an encrypted file? - correct answer ✔ansible-vault create
secret.yml
or pass a secret in via a file:
ansible-vault create --vault-password-file=vault-pass secret.yml
How to change the password for an encrypted file? - correct answer
✔ansible-vault rekey secret.yml