Created
February 6, 2023 16:13
-
-
Save mkanoor/0e8bdd614ccccac60150c2395cc1a9f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - name: multiple conditions with assignments | |
| hosts: all | |
| sources: | |
| - range: | |
| limit: 5 | |
| rules: | |
| - name: r1 | |
| condition: | |
| all: | |
| - events.abc << event.i == 1 | |
| - events.saved << fact.k is defined | |
| - event.i == events.saved.k | |
| - event.i == events.abc.i + events.m_2.i | |
| action: | |
| debug: | |
| first: "{{ ansible_eda.events.abc }}" | |
| second: "{{ ansible_eda.events.saved }}" | |
| third: "{{ ansible_eda.events.m_2 }}" | |
| fourth: "{{ ansible_eda.events.m_3 }}" | |
| - name: r2 | |
| condition: event.i == 0 | |
| action: | |
| set_fact: | |
| fact: | |
| k: 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment