mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-21 20:30:42 +00:00
fix: ignore complex changed when checks in rule CheckChangedInWhen (#628)
This commit is contained in:
parent
a38a9aa11b
commit
26ce453fc4
@ -36,7 +36,7 @@ class CheckChangedInWhen(StandardBase):
|
||||
for task in tasks:
|
||||
when = None
|
||||
|
||||
if task["__ansible_action_type__"] == "task":
|
||||
if task["__ansible_action_type__"] in ["task", "meta"]:
|
||||
when = task.get("when")
|
||||
|
||||
if isinstance(when, str):
|
||||
@ -54,6 +54,15 @@ class CheckChangedInWhen(StandardBase):
|
||||
if not isinstance(item, str):
|
||||
return False
|
||||
|
||||
if not {"and", "or", "not"}.isdisjoint(item.split()):
|
||||
return False
|
||||
|
||||
return any(
|
||||
changed in item for changed in [".changed", "|changed", '["changed"]', "['changed']"]
|
||||
changed in item for changed in [
|
||||
".changed",
|
||||
"|changed",
|
||||
'["changed"]',
|
||||
"['changed']",
|
||||
"is changed",
|
||||
]
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user