diff options
author | Hossein Zolfi <hossein.zolfi@gmail.com> | 2021-08-12 15:46:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-12 15:46:02 +0200 |
commit | 3d872fb5e8e43ac8621b7f126a5639dc74df8d8b (patch) | |
tree | 1b2ec37823e93d4c4a56cdfa385fe85b639d6ab9 /test/integration/targets/lookup_template | |
parent | ansible-test - Upgrade pylint to 2.9.3. (#75480) (diff) | |
download | ansible-3d872fb5e8e43ac8621b7f126a5639dc74df8d8b.tar.xz ansible-3d872fb5e8e43ac8621b7f126a5639dc74df8d8b.zip |
Add new comment attribute to template plugin (#69253)
* Add new comment attribute to template plugin
Add comment_start_string and comment_end_string attribute to template
plugin
Co-authored-by: Hossein Zolfi <h.zolfi@inside.sahab.ir>
Diffstat (limited to 'test/integration/targets/lookup_template')
-rw-r--r-- | test/integration/targets/lookup_template/tasks/main.yml | 8 | ||||
-rw-r--r-- | test/integration/targets/lookup_template/templates/hello_comment.txt | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/test/integration/targets/lookup_template/tasks/main.yml b/test/integration/targets/lookup_template/tasks/main.yml index df11576654..36a8ee3132 100644 --- a/test/integration/targets/lookup_template/tasks/main.yml +++ b/test/integration/targets/lookup_template/tasks/main.yml @@ -17,3 +17,11 @@ - assert: that: - "hello_world_string|trim == 'Hello world!'" + +- name: Test that we have a proper jinja search path in template lookup with different comment start and end string + set_fact: + hello_world_comment: "{{ lookup('template', 'hello_comment.txt', comment_start_string='[#', comment_end_string='#]') }}" + +- assert: + that: + - "hello_world_comment|trim == 'Hello world!'" diff --git a/test/integration/targets/lookup_template/templates/hello_comment.txt b/test/integration/targets/lookup_template/templates/hello_comment.txt new file mode 100644 index 0000000000..92af4b3770 --- /dev/null +++ b/test/integration/targets/lookup_template/templates/hello_comment.txt @@ -0,0 +1,2 @@ +[# Comment #] +Hello world! |