mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Empty plays should still gather facts
This commit is contained in:
@@ -224,7 +224,9 @@ class PlayBook(object):
|
||||
|
||||
# if we have matched_tags, the play must be run.
|
||||
# if the play contains no tasks, assume we just want to gather facts
|
||||
if (len(matched_tags) > 0 or len(play.tasks()) == 0):
|
||||
# in this case there are actually 4 meta tasks (handler flushes) not 0
|
||||
# tasks, so that's why there's a check against 4.
|
||||
if (len(matched_tags) > 0 or len(play.tasks()) == 4):
|
||||
plays.append(play)
|
||||
|
||||
# if the playbook is invoked with --tags that don't exist at all in the playbooks
|
||||
@@ -519,7 +521,6 @@ class PlayBook(object):
|
||||
should_run = False
|
||||
for x in self.only_tags:
|
||||
|
||||
|
||||
for y in task.tags:
|
||||
if (x==y):
|
||||
should_run = True
|
||||
|
||||
Reference in New Issue
Block a user