Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for raw cron schedules #54263

Open
wants to merge 2 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@evilhamsterman
Copy link

commented Mar 22, 2019

SUMMARY

This adds support for using raw cron schedules such as 0 23 * * * rather than specifying the minutes, hours, etc. individually. Some people are used to doing cron lines and similar to how the file module lets people use octal or symbolic mode.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

cron

ADDITIONAL INFORMATION

Example of equivalent cron jobs with old and new format

- name: Creates and entry with minute and hour settings
    become: yes
    cron:
      name: "a cron job"
      minute: "30"
      hour: "20"
      job: "/bin/tar cf backup.tar /backup"

  - name: Creates and entry with a raw cron schedule string
    become: yes
    cron:
      name: "a raw cron job"
      schedule: "30 20 * * *"
      job: "/bin/tar cf backup.tar /backup"

evilhamsterman added some commits Mar 22, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2019

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/system/cron.py:0:0: E309 version_added for new option (schedule) should be '2.8'. Currently StrictVersion ('0.0')

click here for bot help

@ansibot

This comment has been minimized.

@resmo

resmo approved these changes Mar 23, 2019

Copy link
Member

left a comment

LGTM

@ansibot ansibot removed the needs_triage label Mar 23, 2019

@ansibot ansibot added the stale_ci label Mar 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.