foreman icon indicating copy to clipboard operation
foreman copied to clipboard

Fixes #36730 - Implement pruning of old TFTP files

Open ekohl opened this issue 2 years ago • 4 comments

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.

ekohl avatar Sep 07 '23 13:09 ekohl

Issues: #36730

theforeman-bot avatar Sep 07 '23 13:09 theforeman-bot

The question for me is -- what should trigger this pruning? An event? A timer?

ehelms avatar Sep 07 '23 16:09 ehelms

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.

ekohl avatar Sep 07 '23 17:09 ekohl

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.

ehelms avatar Sep 07 '23 17:09 ehelms