mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Do not consider skipped targets as failed for ansible.playbooks state
This commit is contained in:
parent
4e91f385d9
commit
60e85eaf01
1 changed files with 4 additions and 15 deletions
|
@ -185,19 +185,13 @@ def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs=
|
|||
name, rundir=rundir, check=True, diff=True, **ansible_kwargs
|
||||
)
|
||||
if all(
|
||||
not check["changed"]
|
||||
and not check["failures"]
|
||||
and not check["unreachable"]
|
||||
and not check["skipped"]
|
||||
not check["changed"] and not check["failures"] and not check["unreachable"]
|
||||
for check in checks["stats"].values()
|
||||
):
|
||||
ret["comment"] = "No changes to be made from playbook {}".format(name)
|
||||
ret["result"] = True
|
||||
elif any(
|
||||
check["changed"]
|
||||
and not check["failures"]
|
||||
and not check["unreachable"]
|
||||
and not check["skipped"]
|
||||
check["changed"] and not check["failures"] and not check["unreachable"]
|
||||
for check in checks["stats"].values()
|
||||
):
|
||||
ret["comment"] = "Changes will be made from playbook {}".format(name)
|
||||
|
@ -214,10 +208,7 @@ def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs=
|
|||
name, rundir=rundir, diff=True, **ansible_kwargs
|
||||
)
|
||||
if all(
|
||||
not check["changed"]
|
||||
and not check["failures"]
|
||||
and not check["unreachable"]
|
||||
and not check["skipped"]
|
||||
not check["changed"] and not check["failures"] and not check["unreachable"]
|
||||
for check in results["stats"].values()
|
||||
):
|
||||
ret["comment"] = "No changes to be made from playbook {}".format(name)
|
||||
|
@ -226,9 +217,7 @@ def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs=
|
|||
else:
|
||||
ret["changes"] = _changes(results)
|
||||
ret["result"] = all(
|
||||
not check["failures"]
|
||||
and not check["unreachable"]
|
||||
and not check["skipped"]
|
||||
not check["failures"] and not check["unreachable"]
|
||||
for check in results["stats"].values()
|
||||
)
|
||||
if ret["result"]:
|
||||
|
|
Loading…
Add table
Reference in a new issue