ansible-rulebook
ansible-rulebook copied to clipboard
Support for standalone Booleans in conditions
Please confirm the following
- [X] I agree to follow this project's code of conduct.
- [X] I have checked the current issues for duplicates.
- [X] I understand that ansible-rulebook is open source software provided for free and that I might not receive a timely response.
Feature type
Enhancement to Existing Feature
Feature Summary
This helps when we want to print events, process all messages in Kafka topic without knowing the contents of the event. The literal boolean true allows the condition to pass and the action various action can be done for events.
Steps to reproduce
- name: print event always
condition: true
action:
print_event:
pretty: true
Current results
Cannot be done
Sugested feature result
Can be passed
Additional information
See this pull request
Hello. To print all the events you can use the flag --print-events
Hello. To print all the events you can use the flag --print-events
Hi, This is an example simpler than reading Kafka topic 😊
So I think we can close this feature request because it's already implemented.
@Alex-Izquierdo I need it for a Kafka topic so it wasn't implemented as far as I know.
The feature as it is described is going to be rejected because can not be implemented. The condition must contains always a query about the event data, this how works and was designed the rule engine.
The usecase of printing all the events is already supported with the flag --print-events.
The feature as it is described is going to be rejected because can not be implemented. The condition must contains always a query about the event data, this how works and was designed the rule engine.
Hi, The use case is relevantly simple:
- We have a Kafka topic with messages to be routed
- The routes and related information (action to do over data) are written in a database
- I want to use ansible-rulebook since our team knows Ansible well
- The messages have different structures and the routing depends on multi parameters
- I have a few rules (different Kafka topics and maybe webhook)
Therefore while filtering is ultimately dependent on event data, it requires features that aren't available in ansible-rulebook (unless you code them in Python...) so the condition doesn't meet our requirements.