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

incorrect handle of runinterval in agent/service/systemd.pp breaks catalog compilation #820

Open
unixsurfer opened this issue Jan 14, 2022 · 3 comments

Comments

@unixsurfer
Copy link

unixsurfer commented Jan 14, 2022

The runinterval parameter accepts values which match /^\d+[smhdy]?$/] pattern, so you can set 15m as value instead of 900.
But, when you set it to 15m as example you get a compilation error:


Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, 'extlib::ip_to_cron' parameter 'runinterval' expects an Integer value, got String (file: /etc/puppetlabs/code/environments/dev/modules/puppet/manifests/agent/service/systemd.pp, line: 10, column: 14) on node puppetserver-003.puppetserver.local1.local.vagrant.dev.foo.com

This happens because runinterval is passed to extlibip_to_cron without making sure it is an integer.

I see this as a bug in puppet::agent::service::systemd class. The only workaround is to set runinterval to integer.

@ekohl
Copy link
Member

ekohl commented Feb 4, 2022

Good find. Do you think we should enhance ip_to_cron to understand the same string format?

@unixsurfer
Copy link
Author

This is one option, the other option is to make the transformation, for instance from 15m to 900, inside puppet::agent::service::systemd.

@jcpunk
Copy link
Contributor

jcpunk commented Jan 10, 2023

I've just hit this issue, for now I'll switch to raw seconds, but being able to specify more human units would be nice.

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

3 participants