Tagging Tasks, Plays & Roles
Attach labels to runnable units.
Why Label Your Work
A big playbook does many things. Tags are simple labels you stick on tasks so you can later run just the parts you want. 🏷️
Tagging a Single Task
Add a tags key to any task with a list of label names. Here the task carries the install tag.
- name: Install nginx
ansible.builtin.package:
name: nginx
state: present
tags:
- installAll lessons in this course
- Tagging Tasks, Plays & Roles
- Filter Runs with --tags & --skip-tags
- The always & never Special Tags
- List Tags & Tasks Before Running