From f5167c76a59a9a6ff4a9afcbd933f3b492ca15c7 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Thu, 23 May 2024 16:12:21 +0100 Subject: [PATCH] ansible: create git repo under `binary_tmp` user (#3733) Create the `binary_tmp` git repository under the home directory for the `binary_tmp` user to avoid permissions issues encountered when previously trying to create it under the `iojs` user. This change will mean that for any machines that mount expanded storage as an additional disk, the `binary_tmp` users' home directory will need to be on the larger storage. In practice this means that the additional disk should be mounted at `/home/` rather than `/home/iojs/`. Fixes: https://github.com/nodejs/build/issues/3732 --- .../roles/jenkins-workspace/tasks/main.yml | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/ansible/roles/jenkins-workspace/tasks/main.yml b/ansible/roles/jenkins-workspace/tasks/main.yml index b802109d0..ddacf2bf0 100644 --- a/ansible/roles/jenkins-workspace/tasks/main.yml +++ b/ansible/roles/jenkins-workspace/tasks/main.yml @@ -39,8 +39,6 @@ user: "binary_tmp" key: "{{ lookup('file', '/tmp/nodejs-ci.keys') }}" -# Repository needs to be created in /home/iojs/build because the partition with -# free space might be mounted in a way that does not include /home/binary_tmp - name: Create repository parent directory file: path: "{{ home }}/{{ server_user }}/build/" @@ -51,22 +49,12 @@ - name: Create repository directory file: - path: "{{ home }}/{{ server_user }}/build/binary_tmp.git" + path: "~binary_tmp/binary_tmp.git" state: directory owner: "binary_tmp" group: "binary_tmp" mode: 0755 -- name: Link to repository directory from bintmp home - file: - src: "{{ home }}/{{ server_user }}/build/binary_tmp.git" - dest: "~binary_tmp/binary_tmp.git" - state: link - owner: "binary_tmp" - group: "binary_tmp" - follow: false - mode: 0755 - - name: Initialize Git repository become: true become_user: binary_tmp @@ -115,9 +103,11 @@ - name: Disable automatic garbage collection become: true become_user: binary_tmp - command: "git config gc.auto 0" - args: - chdir: "~binary_tmp/binary_tmp.git/" + community.general.git_config: + name: gc.auto + file: "~binary_tmp/binary_tmp.git/config" + scope: file + value: 0 - name: Add nodesource signing key apt_key: