-
Notifications
You must be signed in to change notification settings - Fork 114
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
fixes #37524 - feat: enable ansible events for webhooks #721
Conversation
Signed-off-by: gardar <[email protected]>
Signed-off-by: gardar <[email protected]>
b34c886
to
9add8cd
Compare
cc @nofaralfasi |
It's a bit challenging for me to review this PR due to the lack of tests and detailed steps to follow. |
I found a community post that clarifies things a bit more: Adding New Custom Webhook Subscriptions. |
Yes that's a post by me. I'm fond of having CI tests for everything, but my knowledge of foreman and the tests done here are not deep enough for me to decide how and if this should be automatically tested. But basically what this PR does is enabling events for updates to ansible roles or variables in foreman, those events can then be used with the foreman webhooks plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @gardar, I've tested it with foreman_webhooks and it works:
In case you want to add some test to cover this, you might inspire by https://github.com/theforeman/foreman/blob/develop/test/models/hosts/managed_test.rb#L126
Great, glad you were able to test it successfully! |
I'd say it's not, but I'm not a maintainer here :) |
I’m generally in favor of having tests, but we can skip them this time. |
@gardar could you open a PR to update the docs https://docs.theforeman.org/nightly/Administering_Project/index-foreman-el.html#webhooks-available-events_admin? |
Enables the following events:
ansible_variable_created.event.foreman
ansible_variable_updated.event.foreman
ansible_variable_destroyed.event.foreman
ansible_role_created.event.foreman
ansible_role_updated.event.foreman
ansible_role_destroyed.event.foreman
Which can then be used with
foreman_webhooks
https://projects.theforeman.org/issues/37524