openqa: improve how we do the git config thing
The background to this is https://bugzilla.redhat.com/show_bug.cgi?id=2073414 , in response to which git was changed to die if a user runs git commands on a repo which it doesn't own. In openQA, the test directory is a git repo and openQA itself likes to run git commands on it, but this is often going to be as a different user than the owner of the directory. In fact on the worker hosts, the user that owns the directory (geekotest on the server box) doesn't even exist. This just sets the config by copying a file in place rather than running a git command (which is hard to get to be idempotent) and uses `/etc/gitconfig` so we don't wind up with a file in the _openqa-worker user's home directory, which is meant to be empty. Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
parent
3d148f5e7f
commit
bf4f704096
2 changed files with 3 additions and 4 deletions
2
roles/openqa/worker/files/gitconfig
Normal file
2
roles/openqa/worker/files/gitconfig
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[safe]
|
||||||
|
directory = /var/lib/openqa/share/tests/fedora
|
|
@ -171,10 +171,7 @@
|
||||||
when: openqa_tap|bool
|
when: openqa_tap|bool
|
||||||
|
|
||||||
- name: Tell git it's OK for _openqa-worker to run 'git' on the test dir
|
- name: Tell git it's OK for _openqa-worker to run 'git' on the test dir
|
||||||
command: git config --global --add safe.directory /var/lib/openqa/share/tests/fedora
|
copy: src=gitconfig dest=/etc/gitconfig owner=root group=root mode=0644
|
||||||
become: yes
|
|
||||||
become_user: _openqa-worker
|
|
||||||
when: openqa_nfs_worker|bool
|
|
||||||
|
|
||||||
# this is kinda lazy - we could have a separate openqa_swtpm var so we
|
# this is kinda lazy - we could have a separate openqa_swtpm var so we
|
||||||
# we could potentially separate tap worker hosts from swtpm ones - but
|
# we could potentially separate tap worker hosts from swtpm ones - but
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue