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

Role fails to run in check mode #70

Closed
Qwiz opened this issue Dec 24, 2020 · 0 comments · Fixed by #73
Closed

Role fails to run in check mode #70

Qwiz opened this issue Dec 24, 2020 · 0 comments · Fixed by #73

Comments

@Qwiz
Copy link

Qwiz commented Dec 24, 2020

Hi!

I tried to run this role in check mode and got an error:

TASK [pdns_recursor-ansible : Set pdns version] ********************************************************************************************************************************************************************
fatal: [***]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'stdout'\n\nThe error appears to be in './roles/pdns_recursor-ansible/tasks/install-Linux.yml': line 40, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n    - name: Set pdns version\n      ^ here\n"}

This happens because task Obtain pdns version string doesn't run in check mode. So _pdns_rec_ver_output variable doesn't have a stdout key.

https://github.com/PowerDNS/pdns_recursor-ansible/blob/master/tasks/install-Linux.yml#L29
Fix is simple, just put check_mode: no in this task. Command doesn't change anything, so it is completely safe to run in even in check mode.

sgf-dma added a commit to best-hosting/pdns_recursor-ansible that referenced this issue Mar 3, 2021
Set '_pdns_rec_version' by default to 0 to avoid variable undefined
errors during check mode.
sgf-dma added a commit to best-hosting/pdns_recursor-ansible that referenced this issue Mar 4, 2021
Set '_pdns_rec_version' by default to 0 to avoid variable undefined
errors during check mode.
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

Successfully merging a pull request may close this issue.

1 participant