Fixed use of bare vars on agent2 tasks for linux #663
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Those tasks began to fail in my setup, and I found this note on ansible docs: "In 2.10 the default setting for conditional_bare_variables will change to false. In 2.12 the old behavior will be deprecated." (https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.8.html). The hints I found on my logs are the same on #662 and #655.
These commits resolved the issue for me.
Fixes #662
Fixes #655
ISSUE TYPE
COMPONENT NAME
zabbix_agent
ADDITIONAL INFORMATION
I could not get exactly what was the intention of the second check. Since it is after the first "is defined" check, I assumed it was to check implicitly if it is an valid string (maybe not empty). I removed it (this second line) because I think the first check makes it safe enough and I can think a better way to ensure it is a valid filename.