Ensure that repositories are owned by the running users

Currently requirements may end up owned by root.

Change-Id: I563af83ddea9fe3392a486c049607151f361faa2
This commit is contained in:
Dmitry Tantsur 2020-09-17 15:54:42 +02:00
parent 460cd00dce
commit 0ef62ca2dc
3 changed files with 23 additions and 0 deletions

View File

@ -53,6 +53,14 @@
clone: yes
when: not copy_from_local_path | bool
- name: ensure ownership of requirements
file:
path: "{{ reqs_git_folder }}"
owner: "{{ ansible_env.SUDO_USER | default(ansible_user_id) }}"
group: "{{ ansible_user_gid }}"
recurse: yes
when: not copy_from_local_path | bool
- name: copy requirements from local path
copy:
src: "{{ reqs_git_url }}/"

View File

@ -34,6 +34,17 @@
- not copy_from_local_path | bool
- item.source_install | default(true) | bool
- name: "Ensure ownership of repositories"
file:
path: "{{ item.git_folder }}"
owner: "{{ ansible_env.SUDO_USER | default(ansible_user_id) }}"
group: "{{ ansible_user_gid }}"
recurse: yes
loop: "{{ bifrost_install_sources }}"
when:
- not copy_from_local_path | bool
- item.source_install | default(true) | bool
- name: "Copy from local path"
copy:
src: "{{ item.git_url }}/"

View File

@ -0,0 +1,4 @@
---
fixes:
- |
Ensures that repositories are consistently owned by the calling user.