Any functionality similar to the action chain

Problem:

I am wondering if there is any functionality similar to the action chain that was available in Spacewalk. Or if there is any way to mimic that functionality with the tools built into Foreman.

Expected outcome:

I’d like to have the ability to combine multiple remote commands, and execute them in order like the action chain in Spacewalk.

A typical use case for me in the past would be sending a simple yum update -y to a machine, and then chaining a reboot command to it so it could reboot after updating

Foreman and Proxy versions:

Foreman version 3.4
Foreman Proxy version 3.4

Foreman and Proxy plugin versions:

Katello 4.6
Remote execution 8.0
Puppet 4.0
foreman-tasks 7.0

Distribution and version:

Almalinux 8.6

Other relevant data:

In general? I don’t think so.

I am probably missing something, but why split it into two jobs? Why not just run a single job that would do both?

Thanks for the quick response!

Well currently, when I run a command via remote execution that ends with a reboot, the results of the remote execution are interpreted incorrectly.

It appears the machine does in fact reboot, but since the machine goes offline during the process, foreman appears to interpret the job as failed.

Open to changing the process completely, but wondering if there is another way I should be going about this.

Instead of reboot use shutdown -r. This schedules the reboot with one minute delay. The task can successfully finish.

Otherwise, you could use traces. The client host uploads the tracer result and you can the search for all the content hosts which require a reboot and reboot only those. This way, you only reboot if it’s really necessary (according to tracer…)

1 Like