Junior — Middle
How to activate and run an Ansible playbook for task automation?
sobes.tech AI
Answer from AI
To activate and run an Ansible playbook, you need to:
- Ensure Ansible is installed and configured.
- Have a playbook — a YAML file describing tasks.
- Run the command:
ansible-playbook path_to_playbook.yml
For example:
ansible-playbook site.yml
Optionally, specify inventory, user, and additional parameters:
ansible-playbook -i inventory.ini -u user site.yml
The playbook will sequentially execute the described tasks on the specified hosts, automating configuration and deployment.