file_key_value_present_option
Ensure that the file contains a pair of "key separator value", with options on the spacing around the separator.
⚙️ Compatible targets: Linux
Parameters
Name | Documentation |
---|---|
path | File name to edit (absolute path on the target node). This parameter is required. |
key | Key to define. This parameter is required. |
value | Value to define. This parameter is required. |
separator | Separator between key and value, for example "=" or " " (without the quotes). This parameter can contain only whitespaces. This parameter is required. |
option | Option for the spacing around the separator: strict, which prevent spacing (space or tabs) around separators, or lax which accepts any number of spaces around separators. Choices:
This parameter is required. |
Outcome conditions
You need to replace ${path}
with its actual canonified value.
- ✅ Ok:
file_key_value_present_${path}_ok
- ☑️ Already compliant:
file_key_value_present_${path}_kept
- 🟨 Repaired:
file_key_value_present_${path}_repaired
- ☑️ Already compliant:
- ❌ Error:
file_key_value_present_${path}_error
Example
method: file_key_value_present_option
params:
path: VALUE
key: VALUE
value: VALUE
separator: VALUE
option: strict
Documentation
Edit (or create) the file, and ensure it contains an entry key -> value with arbitrary separator between the key and its value. If the key is already present, the method will change the value associated with this key.