From: Oleg Broytman Date: Thu, 11 Jan 2024 12:29:55 +0000 (+0300) Subject: Feat(fetch-push): Allow plain directory X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=a42d32d88cda8669916bf43a0a96b25549b97576;p=ansible.git Feat(fetch-push): Allow plain directory Allow to omit hostname directory. --- 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') }}"