diff options
author | 2019-06-04 12:47:20 +0200 | |
---|---|---|
committer | 2019-06-04 12:47:20 +0200 | |
commit | 76e017afde67940e80efeaec546c04bef2dadff2 (patch) | |
tree | 885df0233f8bf50b3e921b03dc318f4ef3442c43 /ansible/roles/resource-data/tasks/unarchive-resource.yml | |
parent | 8636d184d6c07df9ef74941a0d4343d61b95c5d4 (diff) |
Replace 'with_items' loop statements with 'loop' keyword
As of Ansible 2.5 'loop' keyword is a recommended way
for looping statements instead of 'with_dict'.
Change-Id: I19e00cc27e13955e2056840fd4ce99841bc824ad
Issue-ID: OOM-1887
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible/roles/resource-data/tasks/unarchive-resource.yml')
-rw-r--r-- | ansible/roles/resource-data/tasks/unarchive-resource.yml | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ansible/roles/resource-data/tasks/unarchive-resource.yml b/ansible/roles/resource-data/tasks/unarchive-resource.yml index 9097ddc8..879a9dfe 100644 --- a/ansible/roles/resource-data/tasks/unarchive-resource.yml +++ b/ansible/roles/resource-data/tasks/unarchive-resource.yml @@ -1,11 +1,11 @@ --- # -# Wrapper to pass through following variables +# Wrapper to pass through following variables: # resources_source_host # resources_dir # resource_source_filename # resource_destination_directory -# And handling target directory creation and possible removal on failure. +# and handle target directory creation and eventual removal on failure. # Idempotence is also handled here as nothing is done if resource_destination_directory # was already created. # @@ -48,9 +48,12 @@ - name: "Cleanup the destination directory {{ resource_destination_directory }} on error" file: - path: "{{ item.path }}" + path: "{{ files_item.path }}" state: absent - with_items: "{{ files_after_fail.files | difference(original_files.files) }}" + loop: "{{ files_after_fail.files | difference(original_files.files) }}" + loop_control: + label: "{{ files_item.path }}" + loop_var: files_item when: files_after_fail is defined - name: "Report failure of upload operation" |