-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
Include vars updated to work with directories #17207
Conversation
f1220f3
to
2b726c8
Compare
c6a2697
to
4b72d28
Compare
Builds are failing not cause of this module |
include_vars.py now allows you to include an entire directory and its nested directories of variable files. Added Features.. * Ignore by default *.md, *.py, and *.pyc * Ignore any list of files. * Only include files nested by depth (default=unlimited) * Match only files matching (valid regex) * Sort files alphabetically and load in that order. * Sort directories alphabetically and load in that order. ``` - include_vars: 'vars/all.yml' - name: include all.yml include_vars: file: 'vars/all.yml' - name: include all yml files in vars/all and all nested directories include_vars: dir: 'vars/all' - name: include all yml files in vars/all and all nested directories and save the output in test. include_vars: dir: 'vars/all' name: test - name: include all yml files in vars/services include_vars: dir: 'vars/services' depth: 1 - name: include only bastion.yml files include_vars: dir: 'vars' files_matching: 'bastion.yml' - name: include only all yml files exception bastion.yml include_vars: dir: 'vars' ignore_files: 'bastion.yml' ```
4b72d28
to
33d0d0d
Compare
@nitzmahone Can you check on the build when you have a moment please. @jimi-c I made the changes we discussed on irc. I added the whitelist for (json, yml, and yaml). I kept the ignore_list as a parameter and not as a default that is extended, which I am using currently. I also removed the unit tests in favor of integration tests. |
@linuxdynasty Yeah, cryptography did a release this weekend that broke all our remote tests- I stuffed a fix in this afternoon and re-queued your PR build. |
Discussed at today's meeting. Merged! Thanks @linuxdynasty for working on this and keeping on top of us to get it reviewed and merged! |
Np and thank you guys for all the hard work you guys have done to build a product like Ansible. |
@abadger this is the PR for the updated documentation ansible/ansible-modules-core#4609 |
As introduced in the following PR: - ansible/ansible#17207 we need to refactor our code.
As introduced in the following PR: - ansible/ansible#17207 we need to refactor our code.
As introduced in the following PR: - ansible/ansible#17207 we need to refactor our code.
As introduced in the following PR: - ansible/ansible#17207 we need to refactor our code.
As introduced in the following PR: - ansible/ansible#17207 we need to refactor our code.
* New features for include_vars include_vars.py now allows you to include an entire directory and its nested directories of variable files. Added Features.. * Ignore by default *.md, *.py, and *.pyc * Ignore any list of files. * Only include files nested by depth (default=unlimited) * Match only files matching (valid regex) * Sort files alphabetically and load in that order. * Sort directories alphabetically and load in that order. ``` - include_vars: 'vars/all.yml' - name: include all.yml include_vars: file: 'vars/all.yml' - name: include all yml files in vars/all and all nested directories include_vars: dir: 'vars/all' - name: include all yml files in vars/all and all nested directories and save the output in test. include_vars: dir: 'vars/all' name: test - name: include all yml files in vars/services include_vars: dir: 'vars/services' depth: 1 - name: include only bastion.yml files include_vars: dir: 'vars' files_matching: 'bastion.yml' - name: include only all yml files exception bastion.yml include_vars: dir: 'vars' ignore_files: 'bastion.yml' ``` * Added whitelist for file extensisions (yaml, yml, json) * Removed unit tests in favor of integration tests
ISSUE TYPE
COMPONENT NAME
include_vars_dir
ANSIBLE VERSION
SUMMARY
include_vars.py now allows you to include an entire directory and its nested directories of variable files. Created this PR in favor of #17195
Features..
This change is