User story #20007
closedWe should be able to return an arbitrary report from the technique editor
Description
When using Rudder, I often find myself wanting to report an information which is not caused by the direct result of a method.
For instance, if I want to audit that a partition is correctly mounted on my node, I need to use a command execution method.
The only methods which let met use a command execution in audit mode are:
- condition from command
- variable from command
Which always return a compliant report, and define a specific condition based on the error code returned by the command.
The condition is pretty useless to build my compliance.
report_unless
method. This method would do nothing, except reporting in two different manners:
- Default case is reporting under a given status
- Except when a specific condition is defined, then, report under a different report status.
For instance, a previous method defined a my_cmd_audit_{true|false}
condition. I want it to return a success when the my_cmd_audit_true
is defined, and an error otherwise.
I will be able to do so, using:
-report_unless: -report_message: my condition was correct! -default_status: error -unless: my_cmd_audit_true -unless_status: success
It is the same logic than when using a condition in a tehcnique, which will always reports a na report, unless the condition is verified.