stephrobert.scaleway.operation_result filter – Build the machine-readable result of an operation
Note
This filter plugin is part of the stephrobert.scaleway collection (version 0.7.0).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install stephrobert.scaleway.
To use it in a playbook, specify: stephrobert.scaleway.operation_result.
Synopsis
Returns the common structure every shipped operation emits, so a pipeline, a ticket or a monitoring system can read what happened without parsing standard output.
Counts are derived from the names rather than passed alongside them, so a count can never contradict its own list.
Input
This describes the input of the filter, the value before | stephrobert.scaleway.operation_result.
Parameter |
Comments |
|---|---|
The operation name, as the collection publishes it. |
Keyword parameters
This describes keyword parameters of the filter. These are the values key1=value1, key2=value2 and so on in the following
example: input | stephrobert.scaleway.operation_result(key1=value1, key2=value2, ...)
Parameter |
Comments |
|---|---|
Names that were already where they should be. Default: |
|
Names the operation changed, or would change in check mode. Default: |
|
When it finished, ISO 8601. |
|
|
|
Objects the operation saw and set aside, each carrying a name and a reason. A refusal without a reason is an assertion nothing verifies. Default: |
|
Which field of those objects carries the reason. Defaults to Default: |
|
When the operation started, ISO 8601. |
|
What the operation acted on, as the caller designated it. |
|
Names, zones or products the operation could not read. Nothing measured is not nothing found, so these are named rather than counted as zero. Default: |
Examples
- name: Publish what the operation did
ansible.builtin.set_fact:
scaleway_operation: >-
{{ 'power_schedule' | stephrobert.scaleway.operation_result(
target='scw_tag_office_hours',
mode=('check' if ansible_check_mode else 'apply'),
changed=['web-01', 'web-03'],
already_compliant=['web-02'],
refused=[{'name': 'db-01', 'reason': 'locked'}],
started_at=debut, completed_at=fin) }}
Return Value
Key |
Description |
|---|---|
The operation result. Returned: success |