Hi all,
Problem:
Using foreman_hooks, it was possible to enable/disable hooks for individual hosts using a host parameter, depending on which an action could be triggered, or not. Now with webhooks, it seems that I’m unable to access a host’s parameters in a webhook template (I’m mostly concerned with the create/delete events).
I can enable/disable webhooks globally using the WebUI for example, but is it possible to achieve more granular control over when a hook is triggered like with foreman_hooks?
Apart from that, more generally in a webhook template, is it impossible to access a host’s IP or MAC address for “Host Created” or “Host Deleted” events? This data can be accessed in a “Host Updated” event.
Expected outcome:
- Being able to enable or disable specific webhooks for individual hosts.
- Being able to access additional host data (like IP, MAC, subnet gateway, etc) in webhook templates for “Host Created” or “Host Deleted” events.
Foreman and Proxy versions:
Version 3.1.3
Foreman and Proxy plugin versions:
foreman_webhooks 3.0.0
Additional data
These are the fields I’m able to access from a webhook template in the case of a “Host Created” event using:
<%=
payload({
"object": @object,
}, with_defaults: false)
-%>
architecture_id
build
build_errors
certname
comment
compute_profile_id
compute_resource_id
content_facet_attributes
created_at
discovery_rule_id
disk
enabled
global_status
grub_pass
hostgroup_id
id
image_file
image_id
initiated_at
installed_at
last_compile
last_report
location_id
lookup_value_matcher
managed
medium_id
model_id
name
operatingsystem_id
organization_id
otp
owner_id
owner_type
provision_method
ptable_id
puppet_ca_proxy_id
puppet_proxy_id
pxe_loader
realm_id
root_pass
updated_at
use_image
uuid
Sorry if I’m missing something obvious and thanks for any help!