Problem:
We needed to iterate over a series of stuck tasks and destroy them
Expected outcome:
We wanted to script it to avoid tedious console sessions.
Foreman and Proxy versions:
foreman 1.24.2 katello 3.14.1
Foreman and Proxy plugin versions:
Distribution and version:
CentOS 7.7
This is the relevant line we devised. Hammer and awk were used to build the array which is iterated to run this command. While this worked perfectly, I am always looking for more elegant solutions.
Another option to keep in mind is that the tasks plugin actually has a built in cleanup rake task. the manual, though a bit outdated, has details on the various options. I believe that this hasn’t changed in a while, but @tasks team can probably answer that. If the list of tasks you are deleting is something you can define using this task’s configuration, you can easily script it without having to deal with manually generating the list etc.