Skip to content

Commit

Permalink
Merge branch 'main' into pull-job
Browse files Browse the repository at this point in the history
  • Loading branch information
bzwei authored May 8, 2023
2 parents 34f7546 + 00bf527 commit bb2227c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
24 changes: 14 additions & 10 deletions docs/conditions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,10 @@ You can optionally alias these attribute(s) using the **<<** operator. For examp
- events.third << event.i == events.first.i + 2
action:
debug:
first: "{{ events.first }}"
second: "{{ events.second }}"
third: "{{ events.third }}"
msg:
- "first: {{ events.first }}"
- "second: {{ events.second }}"
- "third: {{ events.third }}"
| When using the assignment operator the attribute names should have the
| **events.** or **facts.** prefix. In the above example we are saving the
Expand All @@ -452,9 +453,10 @@ You can optionally alias these attribute(s) using the **<<** operator. For examp
- event.i == events.m_0.i + 2
action:
debug:
first: "{{ events.m_0 }}"
second: "{{ events.m_1 }}"
third: "{{ events.m_2 }}"
msg:
- "first: {{ events.m_0 }}"
- "second: {{ events.m_1 }}"
- "third: {{ events.m_2 }}"
Multiple condition with default assignments
-------------------------------------------
Expand All @@ -469,9 +471,10 @@ Multiple condition with default assignments
- event.i == events.m.i + 3
action:
debug:
first: "{{events.m}}"
second: "{{events.m_1}}"
third: "{{events.m_2}}"
msg:
- "first: {{ events.m_0 }}"
- "second: {{ events.m_1 }}"
- "third: {{ events.m_2 }}"
The first match is stored as **m**, and the subsequent ones are stored as **m_1**, **m_2** ...

Expand All @@ -484,7 +487,8 @@ Single condition assignment (Not supported)
condition: event.first << event.i == 0
action:
debug:
event: "{{event}}"
msg:
- "event: {{event}}"
| Assignment **cannot** be used for rules that have a single condition, the
| matching event will always be called **event**. In the above example **event.first**
Expand Down
1 change: 1 addition & 0 deletions requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ dynaconf==3.1.11
freezegun
oauthlib>=3.2.0
kubernetes
urllib3<2

0 comments on commit bb2227c

Please sign in to comment.