From a42d32d88cda8669916bf43a0a96b25549b97576 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 11 Jan 2024 15:29:55 +0300 Subject: [PATCH] Feat(fetch-push): Allow plain directory Allow to omit hostname directory. --- playbooks/fetch-push/fetch.yaml | 2 +- playbooks/fetch-push/push.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/fetch-push/fetch.yaml b/playbooks/fetch-push/fetch.yaml index b2f20c8..59214cb 100644 --- a/playbooks/fetch-push/fetch.yaml +++ b/playbooks/fetch-push/fetch.yaml @@ -5,6 +5,6 @@ - name: Fetch files fetch: src: "{{ item }}" - dest: "{{ start_dir }}/{{ inventory_hostname }}/" + dest: "{{ start_dir }}/{% if not plain_dir %}{{ inventory_hostname }}/{% endif %}" flat: yes loop: "{{ files.split(',') }}" diff --git a/playbooks/fetch-push/push.yaml b/playbooks/fetch-push/push.yaml index b2ad0e2..35379b6 100644 --- a/playbooks/fetch-push/push.yaml +++ b/playbooks/fetch-push/push.yaml @@ -5,7 +5,7 @@ tasks: - name: Copy files copy: - src: "{{ start_dir }}/{{ inventory_hostname }}/{{ item }}" + src: "{{ start_dir }}/{% if not plain_dir %}{{ inventory_hostname }}/{% endif %}{{ item }}" dest: "{{ dest_dir }}/" owner: "{{ owner | default('root') }}" group: "{{ group | default('root') }}" -- 2.39.5