template: add additional variable for dest path (#52015)

Signed-off-by: Dustin Spicuzza <dustin@virtualroadside.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde
2019-02-19 14:15:19 +05:30
committed by GitHub
parent 13fa284946
commit 24d1886499
6 changed files with 41 additions and 17 deletions

View File

@@ -667,5 +667,23 @@
- list_var.1.foo is not defined
- list_var.1.foo | default('DEFAULT') == 'DEFAULT'
- template:
src: template_destpath_test.j2
dest: "{{ output_dir }}/template_destpath.templated"
- copy:
content: "{{ output_dir}}/template_destpath.templated\n"
dest: "{{ output_dir }}/template_destpath.expected"
- name: compare templated file to known good template_destpath
shell: diff -uw {{output_dir}}/template_destpath.templated {{output_dir}}/template_destpath.expected
register: diff_result
- name: verify templated template_destpath matches known good
assert:
that:
- 'diff_result.stdout == ""'
- "diff_result.rc == 0"
# aliases file requires root for template tests so this should be safe
- include: backup_test.yml

View File

@@ -0,0 +1 @@
{{ template_destpath }}