Open OrangeDog opened 8 months ago
If there is a default hash_id, I think it would work better if it included the minion id and also the values of the user
and identifier
args to cron.present
. That way if the same minion has multiple jobs running at H H * * *
, they won't all start at the same time.
Btw, I think I found a somewhat hacky way to implement this in jinja in https://github.com/saltstack/salt/issues/60567#issuecomment-2105995223, but native support would be nicer.
Is your feature request related to a problem? Please describe. When you want to run a schedule periodically, independent of the service start time, but not have minions all fire at the same time.
Describe the solution you'd like Being able to supply "Jenkins-style" hashed expressions in the cron specification.
A basic implementation could supply the minion id as the
hash_id
for every usage ofcron
. However, allowing the user to provide their owncron_hash
may be preferable, especially as the presence ofhash_id
affects the meaning of keywords (e.g.@weekly
).It could detect an
H
in the input and provide a fallback hash if one is not set to make things easier.Describe alternatives you've considered
splay
provides similar functionality, but does not give a consistent period and does not work with cron specifications.Additional context Requires
croniter >= 1.0.12