From f607fd9a24739f8cf314c09e5c3a4af4ab59918b Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 24 Feb 2020 19:30:20 +0000 Subject: [PATCH] Precreate AFS target directory in upload This works around missing parent directories in AFS, since rsync will create the target directory but not its parent directories. In cases where the parent directory does not yet exist, it's nice to create it automatically first, if we can. Change-Id: Ia136ea3a416d6085d1f6e277b4c071573c5660e4 --- roles/upload-afs-synchronize/tasks/main.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/upload-afs-synchronize/tasks/main.yaml b/roles/upload-afs-synchronize/tasks/main.yaml index 7f04796d1..492b47f5c 100644 --- a/roles/upload-afs-synchronize/tasks/main.yaml +++ b/roles/upload-afs-synchronize/tasks/main.yaml @@ -1,3 +1,9 @@ +- name: Precreate AFS target directory + # rsync will create the target directory but not its parent directories + # which may not yet exist + file: + path: "{{ afs_target }}" + state: directory - name: Upload contents to AFS synchronize: src: "{{ afs_source }}"