Foreman 2.0 will be coming out with a new subscriber API. It allows users and devs to create Foreman plugins with Ruby code that is called after there is an event in Foreman. After some experience with foreman_hooks plugin which provides similar feature with shell scripts, we have decided to start small:
- host is created, updated, deleted, enters or exits build state
- hostgroup is created, updated, deleted
Actions do happen via Rails instrumentation API from after_commit ActiveRecord callback and not via validators which prevents plugins from canceling transactions or performing other calls when transaction hasn’t been committed yet.
Foreman 2.0 is the first phase when we want to give our users and devs the tool, in the upcoming weeks we would like to introduce these plugins currently in prototypes:
- foreman_webhooks - Github-like stype configurable webook caller
- foreman_redishooks - simple publisher via Redis Pub-Sub protocol with example receiver written in Ruby and/or Python for those who prefer more foreman_hooks experience
We expect one or both these plugins to be part of the foreman core plugin ecosystem after the 2.0 release. Let me know what you think and also what evens you would like to see to be published.