This guide explains how to run an Ansible playbook that executes specific roles using tags. Tags are useful for running specific parts of your playbook without executing the entire playbook.
- Ansible installed on your control node.
- An inventory file (
inventory.ini) that lists your target hosts. - A playbook file (
roles.yaml) that defines the roles and tasks. - Properly configured roles in your Ansible directory structure.
To execute the playbook with a specific tag, use the following command:
ansible-playbook roles.yaml -i ../inventory.ini --tags=httpd