From the course: Red Hat Certified Engineer (EX294) Cert Prep: 2 Using Ansible Playbooks

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using tags

Using tags

- [Instructor] We can make large configurations more manageable by breaking our playbooks into smaller files using blocks to group content and by using tags. Tags differ from the other methods because they allow us to apply a label to different parts of a playbook and only run those sections, or we could run everything but those sections. This allows us to group together configuration data in a completely different and more dynamic way. Tags can be applied to plays, tasks, blocks, roles, and imported roles. It's important to note that multiple items can have the same tag. We can also apply multiple tags to one item in a playbook. When running playbooks, we can specify multiple tags to run. If you apply tags to non-task items such as plays, blocks, roles, and imported tags, the tags get inherited by all tasks contained within them. This is often easier than applying tags to every single task. Tags cannot, however, be…

Contents