Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-40686

Rework Foreman's recurring tasks in foremanctl

XMLWordPrintable

    • Icon: Epic Epic
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Tasks Plugin
    • None
    • Foreman recurring tasks
    • To Do
    • SAT-40449 - Containerization overflow
    • False
    • Satellite Endeavour Refinement
    • sat-endeavour
    • None
    • None
    • None

      Goal:

      Foreman has various recurring tasks that today run via cron. Foremanctl should avoid cron and instead try to provide container native solutions where possible.

      Foreman plugins that depend on foreman-tasks should use recurring logic because it plays nicely into complex multi-server deployments. For plugins that don't or foreman-tasks itself a simple mechanism should be provided. That way a sprawl of jobs is avoided.

      The framework for this is a set of rake tasks in Foreman core. It will provide them with their based on the schedule:

      • foreman-rake cron:hourly
      • foreman-rake cron:daily
      • foreman-rake cron:weekly
      • foreman-rake cron:monthly

      Then foremanctl implements systemd timers to run these are the scheduled interval. The timers may use RandomizedDelaySec= or FixedRandomDelay= to avoid all jobs on the server running at exactly the same time, but is not required.

      Background on where it was initially suggested: https://github.com/theforeman/foremanctl/pull/288#pullrequestreview-3472321405.

      An upstream RFC should be created for this to describe the design. This allows pointing plugin developers to how it's preferred.

      This limits users on selecting the exact schedule, but that's a feature. When upgrading we won't make an effort to detect the existing schedule. A release note should cover this change in behavior.

      Acceptance criteria:

      • In upstream an RFC is created that describes the design
      • Foreman is enhanced to implement the hourly, daily, weekly and monthly rake tasks
      • Existing cronjobs in Foreman and Satellite are either converted to foreman-tasks or the new scheduled jobs
      • For upstream users that don't use a containerized installation (yet) the cronjobs deployed by packaging are updated
      • Upstream a release note about this is written

              Unassigned Unassigned
              ekohlvan@redhat.com Ewoud Kohl van Wijngaarden
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: