How to schedule foreman/katello job to be picked up by OFFLINE hosts when they eventually come online...?

In testing Foreman/Katello in our space, I was curious if jobs would be “picked up” by hosts when they became available, as we regularly have hosts offline/online at random. So I chose 2 hosts, powered one off, and pushed an SSH script. One succeeded, one timed out and permanently ended the task/job. Powering up the second host resulted in no action (As expected after seeing the timeout in Foreman).
I looked at job options and saw “Schedule Future Execution” and “Recurring execution”. Neither seem to be what I need.

Expected outcome:
One succeed. The second stays incomplete until it powers up, checks in with Foreman, completes the task.
Interface of Foreman shows 50% completion until second host wakes up and does it task, then Foreman shows 100% completion.
If second host never wakes up, Foreman shows 50% completion forever.

Foreman and Proxy versions:
Latest I believe (2.3.5)

Foreman and Proxy plugin versions:
|foreman-tasks |3.0.6|
|foreman_remote_execution |4.2.2|
|katello |3.18.5|

Distribution and version:
Not sure

Other relevant data:
Hosts are CentOS7
I’m still learning, here. Our end goal is to find a replacement for Spacewalk. So far Foreman/Katello is the most promising.

As far as I am aware of, there is no option in Foreman/Katello for what you are looking for.
The reason for this is the different approach to remote jobs with Foreman.
Spacewalk utilized a pull method via message queuing where the client had to actively pickup a job for it to be executed. Foreman utilizes a push method, where the server actively tells the client what to do.
The pull method has the advantage that jobs can be picked up later, when the client is ready, but at the cost of no control over when a job is actually executed and the requirement for a client component and a generally more error-prone setup in general (at least in my experience).
Katello (as far as I am aware of) still supports a very limited pull execution exclusivly for package updates through katello-agent, but that has been deprecated for quite a while by now.


Currently there’s no proper way of doing that. It will eventually be possible once some additional changes for pull provider for remote execution land.

1 Like