mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
changes
is not present when the playbook fails.
For example, running locally, under non-root account, ansible complains about missing sudo password.
This commit is contained in:
parent
241009d4fa
commit
5d62aebadd
1 changed files with 2 additions and 1 deletions
|
@ -120,12 +120,13 @@ def _changes(plays):
|
|||
Find changes in ansible return data
|
||||
"""
|
||||
changes = {}
|
||||
|
||||
for play in plays["plays"]:
|
||||
task_changes = {}
|
||||
for task in play["tasks"]:
|
||||
host_changes = {}
|
||||
for host, data in task["hosts"].items():
|
||||
if data["changed"] is True:
|
||||
if data.get("changed", False) is True:
|
||||
host_changes[host] = data.get("diff", data.get("changes", {}))
|
||||
elif any(x in data for x in ["failed", "skipped", "unreachable"]):
|
||||
host_changes[host] = data.get("results", data.get("msg", {}))
|
||||
|
|
Loading…
Add table
Reference in a new issue