Foreman/Katello automated action

I am running Katello 3.10 and would like to create an automated action/script that will execute only when a new host subscribes to Katello via an activation key.

In more detail what I am trying to do is this:

  1. New host is subscribed to Katello via an activation key. (We do not use Foreman/Katello to deploy servers or I would add it in the deployment.)
  2. Right now when a new host is subscribed its placed in a Host Group.
  3. In addition to the above I would like an action to happen to call an external (to Foreman) script.
  4. The script (already written) takes the hostname as input. Does some work on it and then adds the host to our Vulnerability Management Scanner for monthly scanning.

What is the best way to perform this in Foreman/Katello? And how hard is it?

Thanks.

@Louis_Bohm have you looked at the Foreman hooks plugin?

I’m not familiar with which hooks you might be able to use, but it seems like there could b host related events you could write actions for.