@ansible-flow/assets 1.0.2-rc.3 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/probe/callback_plugins/afd_events.py +17 -0
- package/samples/edge-baseline.flow.yaml +1 -0
- package/samples/playbooks/edge-baseline/group_vars/edge.yml +3 -0
- package/samples/playbooks/edge-baseline/roles/push_baseline/meta/argument_specs.yml +4 -0
- package/samples/playbooks/edge-baseline/roles/push_baseline/templates/aaa.j2 +1 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Ansible Flow Designer files a host passes by path: the Python probe, the run events callback, the JSON schemas, the contract with Ansible Flow Server and the sample projects.
|
|
4
4
|
|
|
5
|
-
Built from [Ansible Flow Designer](https://github.com/ChistokhinSV/ansible-flow-designer) 1.0.2
|
|
5
|
+
Built from [Ansible Flow Designer](https://github.com/ChistokhinSV/ansible-flow-designer) 1.0.2
|
|
6
6
|
and released with it. The folders are found by path: `import { probeDir, schemaDir, contractDir, samplesDir } from '@ansible-flow/assets'`.
|
|
7
7
|
|
|
8
8
|
What is in the package, which entry points are documented and what may change:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ansible-flow/assets",
|
|
3
|
-
"version": "1.0.2
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Ansible Flow Designer files a host passes by path: the Python probe, the run events callback, the JSON schemas, the contract with Ansible Flow Server and the sample projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/ChistokhinSV/ansible-flow-designer/blob/main/docs/packages.md",
|
|
@@ -262,6 +262,23 @@ class CallbackModule(CallbackBase):
|
|
|
262
262
|
self._emit(**event)
|
|
263
263
|
return
|
|
264
264
|
message = data.get("msg") or data.get("reason")
|
|
265
|
+
# AFD-359: a task its failed_when failed has no message of its own; Ansible says
|
|
266
|
+
# "Unknown error". The condition is the reason. A task with a message of its own (a
|
|
267
|
+
# TODO step's debug msg) keeps it.
|
|
268
|
+
if (
|
|
269
|
+
status == "failed"
|
|
270
|
+
and data.get("failed_when_result") is True
|
|
271
|
+
and (
|
|
272
|
+
not message
|
|
273
|
+
or "Unknown error" in str(message)
|
|
274
|
+
or "'failed_when' expression evaluated" in str(message)
|
|
275
|
+
)
|
|
276
|
+
):
|
|
277
|
+
conditions = getattr(result._task, "failed_when", None) or []
|
|
278
|
+
if isinstance(conditions, str):
|
|
279
|
+
conditions = [conditions]
|
|
280
|
+
said = " and ".join(str(c) for c in conditions if c is not None)
|
|
281
|
+
message = "Its failed_when condition was true" + (f": {said}" if said else "")
|
|
265
282
|
if status in ("failed", "unreachable") and message:
|
|
266
283
|
event["msg"] = str(message)[:MSG_LIMIT]
|
|
267
284
|
routing = "group" in event or "added" in event or result._task.action in ROUTING
|