Skip to content

Add a cron_provider fact #1108

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

Closed
wants to merge 1 commit into from
Closed

Conversation

ekohl
Copy link
Collaborator

@ekohl ekohl commented May 13, 2020

Similar to package_provider and service_provider the cron provider is useful to know. On some minimal platforms, crontab is not installed and the cron type should not be used. By having a fact for this, it becomes easy to check.

@sheenaajay
Copy link
Contributor

Thanks @ekohl for submitting the PR. Could you please fix the rubocop error. Thank you.

Similar to package_provider and service_provider the cron provider is
useful to know. On some minimal platforms, crontab is not installed and
the cron type should not be used. By having a fact for this, it becomes
easy to check.
@ekohl ekohl force-pushed the add-cron-provider branch from 9f3791f to c68368c Compare May 18, 2020 10:31
@ekohl
Copy link
Collaborator Author

ekohl commented May 18, 2020

Updated

@pmcmaw
Copy link
Contributor

pmcmaw commented May 19, 2020

As there are inconsistent failures on travis and appveyor I am going to close and reopen your PR to reckick the jobs. :-)

@pmcmaw pmcmaw closed this May 19, 2020
@pmcmaw pmcmaw reopened this May 19, 2020
@ekohl
Copy link
Collaborator Author

ekohl commented May 19, 2020

This is an interesting one to see in the failure (for a different fact):

[2020-05-19 09:28:57.508594 ] ERROR Facter - Error loading fact /home/travis/build/puppetlabs/puppetlabs-stdlib/lib/facter/cron_provider.rb: cannot load such file -- puppet/type/cron 

I can't quite explain that, but should I catch that LoadError in my custom fact?

@pmcmaw
Copy link
Contributor

pmcmaw commented May 20, 2020

@ekohl Puppet 6 does not ship with cron as it is now self contained in its own module. For this reason I think that your PR would be better suited to the core cron module: https://github.com/puppetlabs/puppetlabs-cron_core

If you submit it there, please ping me on the PR so I can make sure it gets merged quickly.

@ekohl
Copy link
Collaborator Author

ekohl commented May 21, 2020

Hmm, that complicates things for my use case. With stdlib I can let my module depend on some release but with the _core modules this isn't really the case. puppetlabs/puppetlabs-cron_core#33 so maybe at some point in the future I can depend on it, but until then I'll create a custom fact in my own module.

@ekohl ekohl closed this May 21, 2020
@ekohl ekohl deleted the add-cron-provider branch May 21, 2020 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants