From 11c95648b157724d73f443620acc720352a6ea13 Mon Sep 17 00:00:00 2001 From: Sudheera Dulan Date: Tue, 2 Apr 2024 11:27:49 +0530 Subject: [PATCH] Changing validation task to use role's tags Changing the validation internal task to check for tags on the role itself and use that if they exist, otherwise fallback to always --- lib/ansible/playbook/role/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/playbook/role/__init__.py b/lib/ansible/playbook/role/__init__.py index 1c82e5335c4..1e555201553 100644 --- a/lib/ansible/playbook/role/__init__.py +++ b/lib/ansible/playbook/role/__init__.py @@ -372,7 +372,8 @@ class Role(Base, Conditional, Taggable, CollectionSearch, Delegatable): }, }, 'name': task_name, - 'tags': ['always'], + # Unless role is specifically tagged, the tag is set to 'always' + 'tags': ['always'] if not self.tags else self.tags, } def _load_role_yaml(self, subdir, main=None, allow_dir=False):