From 9008b7b0e718475ce33a29f6b5be661a4e0d4631 Mon Sep 17 00:00:00 2001 From: Tim Gerla Date: Mon, 2 Nov 2015 11:47:18 -0500 Subject: [PATCH] Clarify how tagged roles work This is a confusing part of roles and tags. Most people assume that tagging a role means that the tagged tasks inside the role will run based on the tags specified. But in reality, it tags the whole role with those tags. --- docsite/rst/playbooks_roles.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docsite/rst/playbooks_roles.rst b/docsite/rst/playbooks_roles.rst index 2cc98117a46..516403ac805 100644 --- a/docsite/rst/playbooks_roles.rst +++ b/docsite/rst/playbooks_roles.rst @@ -238,6 +238,7 @@ Finally, you may wish to assign tags to the roles you specify. You can do so inl roles: - { role: foo, tags: ["bar", "baz"] } +Note that this *tags all of the tasks in that role with the tags specified*, overriding any tags that are specified inside the role. If you find yourself building a role with lots of tags and you want to call subsets of the role at different times, you should consider just splitting that role into multiple roles. If the play still has a 'tasks' section, those tasks are executed after roles are applied.