From 27c3f7ac1e52e4fa643cf2d53ea150f896987dca Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 27 Nov 2020 11:11:01 +1100 Subject: [PATCH] gerrit: fix db/ mount for gate testing The gate testing sets gerrit_database_type to 'h2', but the container does not setup /var/gerrit/db. It ends up owned by root in the container and gerrit can't write to it, causing traceback errors for account_patch_reviews when anything is updated. Add a db peer directory with the other config dirs, and make sure it is bind mounted into the image in the same way. While we are here, alphabetise this list of directories for consistency. Change-Id: Ib24e3027622a711db76d24172b27cdebe6152cb6 --- playbooks/roles/gerrit/defaults/main.yaml | 7 ++++--- playbooks/roles/gerrit/tasks/main.yaml | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/playbooks/roles/gerrit/defaults/main.yaml b/playbooks/roles/gerrit/defaults/main.yaml index 36859e2dd5..c82db6b8da 100644 --- a/playbooks/roles/gerrit/defaults/main.yaml +++ b/playbooks/roles/gerrit/defaults/main.yaml @@ -7,16 +7,17 @@ gerrit_run_init: false gerrit_packed_git_open_files: 4096 gerrit_container_image: docker.io/opendevorg/gerrit:3.2 gerrit_container_volumes: + - /home/gerrit2/.launchpadlib:/var/gerrit/.launchpadlib + - /home/gerrit2/.ssh:/var/gerrit/.ssh - /home/gerrit2/review_site/cache:/var/gerrit/cache + - /home/gerrit2/review_site/db:/var/gerrit/db - /home/gerrit2/review_site/etc:/var/gerrit/etc - /home/gerrit2/review_site/git:/var/gerrit/git - - /home/gerrit2/review_site/tmp:/var/gerrit/tmp - /home/gerrit2/review_site/hooks:/var/gerrit/hooks - /home/gerrit2/review_site/index:/var/gerrit/index - /home/gerrit2/review_site/logs:/var/log/gerrit - /home/gerrit2/review_site/static:/var/gerrit/static - - /home/gerrit2/.launchpadlib:/var/gerrit/.launchpadlib - - /home/gerrit2/.ssh:/var/gerrit/.ssh + - /home/gerrit2/review_site/tmp:/var/gerrit/tmp - /opt/project-config/gerrit/projects.yaml:/var/gerrit/etc/projects.yaml - /opt/project-config/gerrit/projects.ini:/var/gerrit/etc/projects.ini gerrit_database_type: MYSQL diff --git a/playbooks/roles/gerrit/tasks/main.yaml b/playbooks/roles/gerrit/tasks/main.yaml index 1c13df7508..c2984f743a 100644 --- a/playbooks/roles/gerrit/tasks/main.yaml +++ b/playbooks/roles/gerrit/tasks/main.yaml @@ -52,14 +52,15 @@ group: "{{ gerrit_user_name }}" mode: 0755 loop: + - cache + - db - etc - git - - index - - cache - - static - hooks - - tmp + - index - logs + - static + - tmp - name: Write Gerrit config file template: