From 9940cd169e931631a0da142f72a8ca6c878e34ed Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sat, 26 Jul 2025 23:40:15 -0700 Subject: CI. Fuck. --- tasks/copy-rendered-templates-recursive.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tasks/copy-rendered-templates-recursive.yml') diff --git a/tasks/copy-rendered-templates-recursive.yml b/tasks/copy-rendered-templates-recursive.yml index 2b83834..3b6055a 100644 --- a/tasks/copy-rendered-templates-recursive.yml +++ b/tasks/copy-rendered-templates-recursive.yml @@ -14,6 +14,7 @@ path: "{{ tempdir.path }}/{{ item.path | dirname }}" state: directory mode: "{{ mode | default('0755') }}" + owner: "{{ owner }}" with_filetree: "{{ render_dir }}" when: item.state == "file" @@ -55,6 +56,7 @@ src: "{{ item.src }}" dest: "{{ tempdir.path }}/{{ item.path }}" mode: "{{ mode | default('0755') }}" + owner: "{{ owner }}" loop: "{{ text_files }}" - name: Copy binary files directly @@ -64,6 +66,7 @@ src: "{{ item.src }}" dest: "{{ tempdir.path }}/{{ item.path }}" mode: "{{ mode | default('0644') }}" + owner: "{{ owner }}" loop: "{{ binary_files }}" - name: Sync rendered and copied files to remote host @@ -72,16 +75,19 @@ ansible.builtin.synchronize: src: "{{ tempdir.path }}/" dest: "{{ tempdir.path }}/" + owner: true + group: true recursive: true - name: Ensure destination exists ansible.builtin.file: path: "{{ destination_dir }}" + owner: "{{ owner }}" state: directory -- name: Copy files to final destination +- name: Copy files to final destination, preserving ownership stuff ansible.builtin.command: - cmd: bash -c 'cp -r {{ tempdir.path }}/* {{ destination_dir }}/' + cmd: bash -c 'cp -rp {{ tempdir.path }}/* {{ destination_dir }}/' - name: Remove local temporary directory delegate_to: localhost -- cgit v1.2.3-70-g09d2