I was wondering has anyone explored Ansible Rulebooks (Event-Driven Ansible)? If so, what kind of projects have you used it with? I have been playing around with it locally with event source plugins such as:
- Webhooks (If disk capacity reaches a certain threshold, run cleanup script)
- URL checks (If website goes down, start it back up)
I think there is potential for Ansible Rulebooks but I’ve not seen it being widely used just yet. I’m curious to hear what kind of projects people have worked on, or ideas you may have with regards to Ansible Rulebooks .
There’s some examples and some though out solutions. It depends on what you need. For example, there’s Network Telegram more examples.. I think one thing is they add more sources (if they do plan to) then it might be easier for others to have more use cases. But, it also varies what logging mechanism you have in your infrastructure.
Event-Driven is fairly capable already, I’d say. There are a handful of source plugins so far that let you ingest events from a variety of sources. New supported source plugins have been releasing every month or so. I imagine there are a number of people in the community experimenting with integrations.
I’m a fan of the observability use case because the events you get out of some observability tool will typically be high level and actionable. If you want to play around with a Prometheus stack, check this project out. I originally built it to demo a Datadog source plugin I put together but added Prometheus and alertmanager later.
I’ve also found that putting together source plugins is not too complex. I recently created one to subscribe to RSS feeds and use a new post to the feed as an event that can be responded to. It’s fun stuff.
Happy to answer EDA questions!
Hello David, in my team we are working with different use cases. One is for server log compression; we use Prometheus and AlertManager to detect if the filesystem is getting filled up. When the alert is triggered, we connect with EDA using AlertManager as the source. Then, we execute a Job Template in Ansible Automation Platform.
Another use case is the increase of Quota for an Openshift Namespace; the procedure would be the same. We detect that the namespace is running out of resources and execute automation via AAP.
Another interesting one that we haven’t yet implemented involves using Dynatrace as a source.
However, I think that type of source is not recommended. The documentation states that it would be better to use Kafka or MQTT. In this way, you send alerts and events to a Kafka topic and define logic in Event-Driven Ansible to execute whatever you need.
I hope this helps.