Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for standalone Booleans in conditions #443

Open
3 tasks done
AssafKatz3 opened this issue Mar 15, 2023 · 6 comments
Open
3 tasks done

Support for standalone Booleans in conditions #443

AssafKatz3 opened this issue Mar 15, 2023 · 6 comments

Comments

@AssafKatz3
Copy link

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • 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

@Alex-Izquierdo
Copy link
Contributor

Hello. To print all the events you can use the flag --print-events

@AssafKatz3
Copy link
Author

Hello. To print all the events you can use the flag --print-events

Hi,
This is an example simpler than reading Kafka topic 😊

@Alex-Izquierdo
Copy link
Contributor

So I think we can close this feature request because it's already implemented.

@AssafKatz3
Copy link
Author

AssafKatz3 commented Mar 15, 2023

@Alex-Izquierdo I need it for a Kafka topic so it wasn't implemented as far as I know.

@Alex-Izquierdo
Copy link
Contributor

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.

@AssafKatz3
Copy link
Author

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:

  1. We have a Kafka topic with messages to be routed
  2. The routes and related information (action to do over data) are written in a database
  3. I want to use ansible-rulebook since our team knows Ansible well
  4. The messages have different structures and the routing depends on multi parameters
  5. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants