Fixes #36730 - Implement pruning of old TFTP files
This implements a rake task orchestration:tftp:prune to prune old files. The actual pruning logic is implemented on the Smart Proxy where Foreman only specified the age (token_duration * 60).
I considered making this a foreman-task, but we can't rely on that so it's a rake task.
Issues: #36730
The question for me is -- what should trigger this pruning? An event? A timer?
Good question.
I thought about some cron/timer/event, but because of the risk it currently might have (https://github.com/theforeman/smart-proxy/pull/873#pullrequestreview-1615476554) I'm hesitant right now.
The very first step could be to replace the existing foreman-maintain code (https://github.com/theforeman/foreman_maintain/blob/master/definitions/checks/foreman_proxy/check_tftp_storage.rb) with invoking this rake task. From an end user perspective there wouldn't a difference, except that it would run on all Smart Proxies instead of just the local one.
The very first step could be to replace the existing foreman-maintain code (https://github.com/theforeman/foreman_maintain/blob/master/definitions/checks/foreman_proxy/check_tftp_storage.rb) with invoking this rake task. From an end user perspective there wouldn't a difference, except that it would run on all Smart Proxies instead of just the local one.
That did occur to me and I think is a fair way to treat this -- purely as a re-factor and then later can consider how it might could be more self-healing.