diff --git a/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml b/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml index cfc0b74cb..c7508f56f 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml +++ b/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml @@ -66,7 +66,13 @@ when: not copy_from_local_path | bool - name: copy requirements from local path - command: cp -a {{ reqs_git_url }} {{ reqs_git_folder }} creates={{ reqs_git_folder }} + copy: + src: "{{ reqs_git_url }}/" + dest: "{{ reqs_git_folder }}/" + remote_src: yes + force: "{{ update_repos | bool }}" + owner: "{{ ansible_env.SUDO_USER | default(ansible_user_id) }}" + group: "{{ ansible_user_gid }}" when: copy_from_local_path | bool - include: prepare_libvirt.yml diff --git a/playbooks/roles/bifrost-prep-for-install/tasks/main.yml b/playbooks/roles/bifrost-prep-for-install/tasks/main.yml index a1630ebec..149f1b05f 100644 --- a/playbooks/roles/bifrost-prep-for-install/tasks/main.yml +++ b/playbooks/roles/bifrost-prep-for-install/tasks/main.yml @@ -35,7 +35,13 @@ - item.source_install | default(true) | bool - name: "Copy from local path" - command: cp -a {{ item.git_url }} {{ item.git_folder }} creates={{ item.git_folder }} + copy: + src: "{{ item.git_url }}/" + dest: "{{ item.git_folder }}/" + remote_src: yes + force: "{{ update_repos | bool }}" + owner: "{{ ansible_env.SUDO_USER | default(ansible_user_id) }}" + group: "{{ ansible_user_gid }}" loop: "{{ bifrost_install_sources }}" when: - copy_from_local_path | bool diff --git a/releasenotes/notes/copy_from_local_path-8aff180483e6bced.yaml b/releasenotes/notes/copy_from_local_path-8aff180483e6bced.yaml new file mode 100644 index 000000000..7f8e78725 --- /dev/null +++ b/releasenotes/notes/copy_from_local_path-8aff180483e6bced.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Correctly updates repositories copied with ``copy_from_local_path``. + - | + When copying repositories using ``copy_from_local_path``, make sure + they are consistently owned by the local user. Previously some + repositories could end up owned by ``root``.