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 tilde (Randomization) #127

Open
ubellavance opened this issue Jan 15, 2024 · 0 comments
Open

Add support for tilde (Randomization) #127

ubellavance opened this issue Jan 15, 2024 · 0 comments

Comments

@ubellavance
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.27.0
  • Ruby:
  • Distribution: RHEL8
  • Module version: 2.0.0

How to reproduce (e.g Puppet code you use)

Trying to create a cronjob with the tilde, which tells cron to use a random valid number

       Randomization  of  the  execution  time within a range can be used.  A random number within a range specified as two numbers separated with a tilde is picked.  The specified range is inclusive.  For example, 6~15 for a 'minutes' entry picks a random minute within 6 to 15
       range.  The random number is picked when crontab file is parsed.  The first number must be less than or equal to the second one. You might omit one or both of the numbers specifying the range.  For example, ~ for a 'minutes' entry picks a random minute  within  0  to  59
       range.

What are you seeing

Error: Evaluation Error: Error while evaluating a Resource Statement, Cron::Job::Multiple[production_atq_adc_send_missing_doc]: parameter 'jobs' index 0 entry 'minute' expects a Cron::Minute = Variant[Integer[0, 59], Pattern[/(?x)\A(
    \* ( \/ ( [1-5][0-9]?|[6-9] ) )?
    |         [1-5]?[0-9] ( - [1-5]?[0-9] ( \/ ( [1-5][0-9]?|[6-9] ) )? )?
        ( ,   [1-5]?[0-9] ( - [1-5]?[0-9] ( \/ ( [1-5][0-9]?|[6-9] ) )? )? )*
  )\z/]] value, got String (file: /etc/puppetlabs/code/environments/branch1/site-modules/blabla/manifests/cron.pp, line: 17) on node atqrh8phpp1.atqlan.agri-tracabilite.qc.ca

What behaviour did you expect instead

Accept the tilde

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant