-
Notifications
You must be signed in to change notification settings - Fork 212
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
crontab and crontab-u parsers fail if the only entry in the file has a special schedule #366
Comments
Thank you for reporting this issue! It looks like this could be a quick fix. Thanks for the samples! |
I have a fix for this in the
Let me know if you run into any other issues! |
(Short version: fix works) This may just be me being dense, but maybe you can help me out. We're using a container to run ansible, and utilizing JC via ansible in the docker container. I have not been able to utilize the $HOME/.local/share/jc/jcparsers directory (/root/.local/share/jc/jcparsers) for parsers while using ansible. I can shell into the container and manually run cat "file" | jc --"custom-parser" and successfully parse, but ansible throws an error saying the parser isn't available. If I rebuild the container to put the file in the jc distribution location under /usr/local, the fix works even through ansible. |
This is a limitation with the Ansible plugin today. It doesn’t find plug-in parsers like the CLI - it only knows about built-in parsers. I can update the Ansible plugin to use the newer API so it can find parsers in the plugin directory. In the mean-time you’d have to manually change out the file under It’s probably about time I update the Ansible plugin. |
No problem, that's easy to do for the container. Thank you very much for the quick response and fix! |
FYI, I have submitted a PR to Ansible Community General to update the |
Added in v1.23.0 |
Apologies if anything is off, this is my first time submitting an issue on github.
I was attempting to use the ansible community.general.jc filter to parse crontab files, and ran into an issue. I have traced it to the crontab and crontab-u parsers. If the file contains only entries with "special" schedules (such as @hourly, @reboot, etc), the parser fails. This is due to the fact that when it reaches the part to append to the raw_output, because it was not initialized, it errors out.
I have attached two files with the example output (you get essentially the same output with crontab-u):
test_jc_with_normal.txt
test_jc_without_normal.txt
The text was updated successfully, but these errors were encountered: