Description of problem:
Satellite 6.2 comes with foreman_tasks:cleanup, a job that will clear old tasks. This works well and helps significantly with issues like slow dashboard loading due to repo sync lookup times, but users need to remember to run the cleanup periodically.
Ideally, if the job was run via cron (similar to orphan task cleanup), users would not hit as many issues related to large numbers of old tasks.
Version-Release number of selected component (if applicable): 6.2.2
Created redmine issue http://projects.theforeman.org/issues/16922 from this bug
Upstream bug assigned to mbacovsk
Please make sure task also deletes all tasks even those which are in error state. I cannot get it working, this does not delete tasks in stopped-error state:
/usr/sbin/foreman-rake foreman_tasks:cleanup TASK_SEARCH='label != a_label' AFTER='30d' STATES="$ALL_STATES
I think this can be a risky thing to do automatically without user opt-in as this does destroy data. Data a user could be using for auditing, tracking, trends. I've commented on the upstream PR  but wanted to include strong consideration for this before we go willy-nilly deleting users data out from under them.
I updated the PR, not sure if here or there is a better place for convo but I don't want it in two places.
*** Bug 1429660 has been marked as a duplicate of this bug. ***
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16922 has been resolved.
Moving to assigned, as the original issue was moved back to ready for testing
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.