Merge "Distinguish zj_source and zj_result and item"

This commit is contained in:
Zuul 2020-05-01 20:52:47 +00:00 committed by Gerrit Code Review
commit 5c44bb56dc

View File

@ -33,15 +33,15 @@
# which is handled here).
- name: Set source and destination for files and folders
set_fact:
source: "{{ zj_source.stat.path }}"
dest: "{{ zj_source.item.value.split('_')[0] }}/{{ zj_source.stat.path|basename|regex_replace('^(\\..*)$', '_\\1') }}{% if zj_source.item.value.endswith('_txt') %}.txt{% endif %}"
type: "{{ zj_source.item.value.split('_')[0] }}"
source: "{{ zj_result.stat.path }}"
dest: "{{ zj_result.zj_source.value.split('_')[0] }}/{{ zj_result.stat.path|basename|regex_replace('^(\\..*)$', '_\\1') }}{% if zj_result.zj_source.value.endswith('_txt') %}.txt{% endif %}"
type: "{{ zj_result.zj_source.value.split('_')[0] }}"
with_items: "{{ sources.results }}"
loop_control:
loop_var: zj_source
loop_var: zj_result
when:
- zj_source.stat.exists
- zj_source.item.value
- zj_result.stat.exists
- zj_result.zj_source.value
register: results
no_log: true