summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/template (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Clean up various integration tests. (#60613)Matt Clay2019-08-154-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | * Fix var_blending test temp dir usage. * Fix filters integration test: - Fix use of `output_dir`. - Use `localhost` instead of `testhost` since we're only testing filters. - Fix `fileglob` test to actually test a directory that exists. * Fix lookups integration test: - Fix use of `output_dir`. - Use `localhost` instead of `testhost` since we're only testing lookups. * Fix ansible-runner test temp dir usage. * Fix template and template_jinja2_latest test. Use the `OUTPUT_DIR` env var to get the output directory for the tests. * Fix Python version compat in filters test. * Skip filters test on Python 2.6.
* Revert "Speed up VariableManager by preserving Templar state. (#45572)" (#59280)Martin Krizek2019-07-224-0/+24
| | | | | This reverts commit 6069d09b9d7193a1896dfc2816e0e51833a53e6b. Fixes #57351
* safe_eval fix (#57188)Brian Coca2019-06-062-0/+55
| | | | | | | | | * just dont pass locals - also fix globals - added tests * fixed tests
* Extend jinja2 nested undefined support to keys/indices (#55094)Matt Martz2019-04-101-0/+18
|
* dataloader: check exact value of dir (#52021)Abhijeet Kasurde2019-03-164-0/+20
| | | | | | | | Include path in role with directory which has 'tasks' as end. For example, roles/sometasks/templates is now considered while searching path. Fixes: #42585 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* test - add setup target that creates the nobody user (#52750)Jordan Borean2019-02-221-0/+1
| | | | | | | | * test - add setup target that creates the nobody user * do not set explicit gid/uid for nobody user * Do no create group and only touch basic attributes
* template: add additional variable for dest path (#52015)Abhijeet Kasurde2019-02-192-0/+19
| | | | | Signed-off-by: Dustin Spicuzza <dustin@virtualroadside.com> Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Custom jinja Undefined class for handling nested undefined attributes (#51768)Andrew Gaffney2019-02-121-0/+25
| | | | This commit creates a custom Jinja2 Undefined class that returns Undefined for any further accesses, rather than raising an exception
* enable template target integration tests on rhel8 beta (#48940)Adam Miller2018-12-051-1/+0
| | | Signed-off-by: Adam Miller <admiller@redhat.com>
* Add CI platform: rhel/8.0 (#48835)Matt Clay2018-11-171-0/+1
|
* Allow specifying the output encoding in the template module (#42171)Julien Champseix2018-07-254-0/+26
| | | | | | | | | | Allow specifying the source and destination files' encodings in the template module * Added output_encoding to the template module, default to utf-8 * Added documentation for the new variables * Leveraged the encoding argument on to_text() and to_bytes() to keep the implementation as simple as possible * Added integration tests with files in utf-8 and windows-1252 encodings, testing all combinations * fix bad smell test by excluding windows-1252 files from the utf8 checks * fix bad smell test by excluding valid files from the smart quote test
* Update Shippable integration test groups. (#43118)Matt Clay2018-07-241-1/+1
| | | | | | | * Update Shippable integration test groups. * Update integration test group aliases. * Rebalance AWS and Azure tests with extra group. * Rebalance Windows tests with another group.
* Fix when template paths contain non-ascii chars and using the path in ↵Toshio Kuratomi2018-05-013-0/+17
| | | | | | ansible_managed Fixes #27262
* Add tests for template with non-ascii filenamesToshio Kuratomi2018-04-262-0/+19
| | | | | | | This is a test in response to #27262 but I could not provoke the error so it only shows that the current code is working with non-ascii filenames in this case. It doesn't show whether there's some other bug somewhere.
* Fixes for mode=preserve (#39343)Toshio Kuratomi2018-04-261-0/+27
| | | | | | | | | | | | | * Fixes for mode=preserve * Document mode=preserve for template and copy * Make mode=preserve work with remote_src for copy * Make mode=preserve work for template * Integration tests for copy & template mode=preserve Fixes #39279 * Changed mode option in win_copy to hidden option as it doesn't reflect copy mode
* template: Add option to `lstrip_blocks' and fix setting`trim_blocks` inline ↵Alex Tsitsimpis2018-03-237-0/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#37478) * template: Add integration tests for `lstrip_blocks' Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com> * template: Fix passing `trim_blocks' inline Fix passing `trim_blocks' option to the template module as inline argument. Previously passing the `trim_blocks' option inline instead of using the YAML dictionary format resulted in it always being set to `True', even if `trim_blocks=False' was used. Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com> * template: Add option to `lstrip_blocks' Add option to set `lstrip_blocks' when using the template module to render Jinja templates. The Jinja documentation suggests that `trim_blocks' and `lstrip_blocks' is a great combination and the template module already provides an option for `trim_blocks'. Note that although `trim_blocks' in Ansible is enabled by default since version 2.4, in order to avoid breaking things keep `lstrip_blocks' disabled by default. Maybe in a future version it could be enabled by default. This seems to address issue #10725 in a more appropriate way than the suggested. Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com> * template: Add integration tests for `trim_blocks' Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com> * template: Check Jinja2 support for `lstrip_blocks' Since the `lstrip_blocks' option was added in Jinja2 version 2.7, raise an exception when `lstrip_blocks' is set but Jinja2 does not support it. Check support for `lstrip_blocks' option by checking `jinja2.defaults' for `LSTRIP_BLOCKS' and do not use `jinja2.__version__' because the latter is set to `unknown' in some cases, perhaps due to bug in `pkg_resources' in Python 2.6.6. Also update option description to state that Jinja2 version >=2.7 is required. Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>
* Fix jinja2>=2.9 nested include vars (#35099)Martin Krizek2018-02-074-21/+44
| | | | | | | This fixes a bug when parent's local vars where not available in nested includes. The bug can only be seen with jinja>=2.9 which changes how the variable scopes work. Fixes #34886
* Check that AnsibleUndefinedVariable doesn't occur when an unused variable ↵Pilou2018-02-022-0/+12
| | | | | | | | references an undefined variable (#35571) * Check that AnsibleUndefinedVariable doesn't occur * AnsibleUndefinedVariable exc.: don't modify type
* Deprecate tests used as filters (#32361)Matt Martz2017-11-271-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Warn on tests used as filters * Update docs, add aliases for tests that fit more gramatically with test syntax * Fix rst formatting * Add successful filter, alias of success * Remove renamed_deprecation, it was overkill * Make directory alias for is_dir * Update tests to use proper jinja test syntax * Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax * Add conversion script, porting guide updates, and changelog updates * Update newly added uses of tests as filters * No underscore variable * Convert recent tests as filter changes to win_stat * Fix some changes related to rebasing a few integration tests * Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name * Add test for tests_as_filters_warning * Update tests as filters in newly added/modified tests * Address recent changes to several integration tests * Address recent changes in cs_vpc
* Add more tests for copy/file/template with harlinksToshio Kuratomi2017-08-181-19/+27
|
* add test for template, file, and copy with hardlinksAndrew Erickson2017-08-181-0/+40
|
* rm unused test template in template intg testsAdrian Likins2017-08-121-3/+0
| | | | | introduced in 501fc7a248c4ad09c2593a200b3fbbdff0e48c70 based on my patch.
* template: fix KeyError: 'undefined variable: 0 (#27972)Zac Medico2017-08-1010-0/+78
| | | | | | | | | | | | | | | | | | | * template: fix KeyError: 'undefined variable: 0 For compatibility with the Context.get_all() implementation in jinja 2.9, make AnsibleJ2Vars implement collections.Mapping. Also, make AnsibleJ2Template.newcontext() handle dict type for the 'vars' parameter. See: https://github.com/pallets/jinja/commit/d67f0fd4cc2a4af08f51f4466150d49da7798729 Fixes: https://github.com/ansible/ansible/issues/20494 * add units/template/test_vars * intg tests for jinja-2.9 issues like 20494 test cases here are based on https://github.com/ansible/ansible/issues/20494#issue-202108318
* [WIP] Create preserved_copy function in basic.py to perserve file ownership. ↵jctanner2017-08-022-0/+63
| | | | | | | | | | | | | | | | | | | (#27344) Create preserved_copy function in basic.py to perserve file ownership. * Add a test for template preserved backup * Use a script to get the random names * bytes to strings * Remove dump of hostvars * Stop being fancy and create a testuser instead * Fix pep8 * set file attributes * Pass the correct data to set_attributes_if_different * Use -j instead -b and pass the attributes as a string instead of a list * remove debugging message * Use shell to softly set the attr Fixes #24408
* Windows: Use the correct newline sequence for the platform (#21846)Dag Wieers2017-03-245-5/+135
| | | | | | | | | | | | | This change to the template action plugin make template use the platform's native newline_sequence for Jinja. We also added the option `newline_sequence` to change the newline sequence using by Jinja if you need to use another newline sequence than the platform default. This was previously discussed in https://github.com/ansible/ansible/issues/16255#issuecomment-278289414 And also relates to issue #21128
* Improve jinja2 test coverage. (#20533)Matt Clay2017-01-211-0/+8
| | | | | | * Run `template` test on latest jinja2 version. * Update jinja2 install for groupby_filter. * Clean test output dir for each test.
* Don't restrict local jinja2 variables to those that start with l_James Cammarata2017-01-204-0/+24
| | | | | | | | | | Per a change in jinja2 2.9, local variables no longer are prefixed with l_, so this updates AnsibleJ2Vars to pull in all locals (while excluding some) regardless of name. Fixes #20063 (cherry picked from commit 4d49b317929b86e1fc1b0cbace825ff73b372dc7)
* minor spelling changesCarlos E. Garcia2016-12-131-1/+1
|
* Initial ansible-test implementation. (#18556)Matt Clay2016-11-301-0/+2
|
* Detect default group in template integration test.Matt Clay2016-11-231-4/+8
|
* Fix cosmetic problems in YAML sourceAdrien Vergé2016-11-112-3/+1
| | | | | | | | This change corrects problems reported by the `yamllint` linter. Since key duplication problems were removed in 4d48711, this commit mainly fixes trailing spaces and extra empty lines at beginning/end of files.
* Migrate Linux CI roles to test targets. (#17997)Matt Clay2016-10-137-0/+268