Problem:
I am trying to send a hosts interface information to a shellhook script when the host gets deleted. Here is the webhook template I am currently using:
<%=
payload({
id: @object.id,
fqdn: @object.name,
os: @object.os,
hostgroup: @object.hostgroup,
interfaces: @object.interfaces
}, with_defaults: true)
-%>
According to /templates_doc/v1/all/Host::Managed.html on our Foreman host, @object.interfaces
should return an array of the hosts interface objects. When parsing this template on the “Host Deleted” event, the array is empty though.
Expected outcome:
Hosts interface information in the payload.
Foreman and Proxy versions:
3.2.1
Foreman and Proxy plugin versions:
- foreman-tasks 6.0.1
- foreman_bootdisk 19.0.3
- foreman_discovery 20.0.1
- foreman_expire_hosts 7.0.4
- foreman_hooks 0.3.17
- foreman_puppet 3.0.7
- foreman_remote_execution 6.0.0
- foreman_scc_manager 1.8.20
- foreman_snapshot_management 2.0.1
- foreman_templates 9.1.0
- foreman_webhooks 3.0.3
- katello 4.4.2.2
- puppetdb_foreman 5.0.0
Distribution and version:
RHEL8
Other relevant data:
This is currently not a big blocker for us, since we cannot migrate from foreman_hooks to a webhook based setup due to other problems, but I would like to keep our codebase prepared for when we need to/are able to switch over.