Skip to content

Commit

Permalink
Merge branch 'main' into add-path-ignores-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ttuffin authored Sep 27, 2023
2 parents 6a17431 + f862c1a commit aac6edc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions ansible_rulebook/schema/ruleset_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
}
},
"required": [
"name",
"hosts",
"sources",
"rules"
Expand Down
27 changes: 27 additions & 0 deletions docs/conditions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -966,3 +966,30 @@ Example:
| if an attribute exists before you use it in a condition. The rule engine
| will check for the existence and only then compare it. If its missing, the
| comparison fails.

| **Q:** If a condition string has an embedded colon followed by a space in it how do I escape it?
| **Ans:** During the rulebook parsing you would see this error message:
| ERROR - Terminating mapping values are not allowed here.
| To resove this eror you would have to quote the whole condition string or use the > or | and
| move the entire condition to a separate line.
Example:
.. code-block:: yaml
name: rule1
condition: 'event.abc == "test: 1"'
.. code-block:: yaml
name: rule1
condition: >
event.abc == "test: 1"
.. code-block:: yaml
name: rule1
condition: |
event.abc == "test: 1"

0 comments on commit aac6edc

Please sign in to comment.