-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
[BUG] Check mode fails to run (JSONDecodeError) #348
Comments
Hmm, I understand the
https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_checkmode.html#id2 @relrod What do you think about me making that adjustment? |
Note to self: also create a molecule test to run the playbook under check mode to catch issues where we will break adherence. |
@artis3n thanks for the super fast response! Yeah I think either way is fine. I haven't delved into the role enough to know what it uses the data for, but I think there are really two possible solutions: Either do what you said and have the command run even in check mode, or skip the tasks that depend on it, when check mode is active. I personally don't have a preference. If you do it the way you said, I guess we'd need to make sure that the command was successful. Because if we're in check mode and running the role for the first time, then tailscale likely might not even be installed on the system yet :) |
Good point 🤔 My first step will be to add the test running |
Thanks. I have some playbooks that run nightly just to check for configuration drift. This had been alerting for a while, but I only just found some time to look into it and open the ticket. Thanks again for the quick response! |
For others who stumble upon this issue, easiest way out for now is to skip this role when running playbook in check mode roles:
- role: "artis3n.tailscale"
# ...
when: >
not ansible_check_mode |
Describe the bug
Since #328 check mode no longer works because the JSON parsing tries to parse an empty string which raises an exception.
To Reproduce
Try to run the role with check mode enabled.
Expected behavior
The same behavior as before #328 ;)
Screenshots
Target (please complete the following information):
artis3n.tailscale
version: latest releaseverbose
to true): irrelevant (check mode is on, so it shouldn't actually shell out to tailscale)Additional context
I think it's just a matter of needing to test if check mode is enabled and skip some steps in the role, but I haven't looked too closely. I'm happy to test if/when there is a patch.
Thanks for your awesome work on this role!
The text was updated successfully, but these errors were encountered: