Adding tags to individual tasks
At the simplest level, you can apply one or more tags to an individual task. You can add tags to tasks in playbooks, in task files, or within a role. Here is an example that tags two tasks with different tags:
You can apply the same tag to more than one individual task. This example tags several tasks with the same tag, “ntp”:
If you ran these four tasks in a playbook with--tagsntp, Ansible would run the three tasks taggedntpand skip the one task that does not have that tag.