@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 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-rc.3
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-rc.3",
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
@@ -77,6 +77,7 @@ nodes:
77
77
  ntp_servers:
78
78
  - 192.0.2.10
79
79
  - 192.0.2.11
80
+ site_name: '{{ site }}'
80
81
  - id: 01JB9EE0ZBGJ09TQM83XSSSS6Y
81
82
  key: validate
82
83
  type: task
@@ -0,0 +1,3 @@
1
+ # The site the edge switches are at, for runs of these playbooks on their own
2
+ # (ansible-playbook site.yml). A flow run's site input is an extra var: it wins over this.
3
+ site: ams-edge
@@ -7,3 +7,7 @@ argument_specs:
7
7
  elements: str
8
8
  required: true
9
9
  description: NTP servers, in order of preference.
10
+ site_name:
11
+ type: str
12
+ default: unknown
13
+ description: The site, written at the top of the AAA file.
@@ -1,2 +1,3 @@
1
+ ! site {{ site_name | default('unknown') }}
1
2
  aaa new-model
2
3
  aaa authentication login default group tacacs+ local