Write a cronjob that will be deployed to all the virthosts that we use for taskotron clients to control the number of qcow2 images cached on those systems. It should delete all but the most recent X images of each type: minimal and server for now but this list of image types will likely grow with time.
X
minimal
server
This cronjob will be deployed with ansible and should have variables for the image directory and the number of each type
This ticket is a duplicate of https://pagure.io/taskotron/issue/120
This ticket had assigned some Differential requests: D761 D757
Relying on file creation date is one option, parsing the filename would probably be more reliable
Isn't this part of the base_image cron jobs?
base_image
! In #576#9571, @tflink wrote: Isn't this part of the base_image cron jobs?
Nope, it takes care of the images inside imagefactory.
To add to the ticket's description - the images follow a naming format, specifically %(timestamp)s-%(distro)-%(release)s-%(flavor)s-%(arch)s, the image "types" are to be devised from the naming scheme (flavor), and we should actually keep last X of all the %(distro)-%(release)s-%(flavor)s-%(arch)s combinations IMHO.
%(timestamp)s-%(distro)-%(release)s-%(flavor)s-%(arch)s
flavor
%(distro)-%(release)s-%(flavor)s-%(arch)s