Fixes # if include_vars dir is file instead of directory code breaks #31157
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
Bug fix for include_var plugin
include_vars:
dir: 'vars/webserver'
extensions: ['yml']
Include_var plugin expects a directory in dir parameter. However if its a file instead of directory the code breaks.
ISSUE TYPE
COMPONENT NAME
include_vars plugin
ANSIBLE VERSION
ADDITIONAL INFORMATION
If the dir param is a file instead of a directory for the include_vars plugin the code breaks with following error.
After change it gives you a message that given path is not a directory.
TASK [webserver : Include all variables] *************************************************************************************************************************
task path: /home/xtreme/workspace/gearbox/gearbox.git/ops/deploy/roles/webserver/tasks/main.yml:2
fatal: [54.210.139.47]: FAILED! => {
"ansible_facts": {},
"ansible_included_var_files": [],
"changed": false,
"failed": true,
"message": "vars/webserver is not a directory"
}