From 9da25e5880e7ddacc40d8e0a85ec7df5c802e811 Mon Sep 17 00:00:00 2001 From: Scott Guymer Date: Tue, 21 Dec 2021 08:59:48 +0100 Subject: [PATCH 1/2] fix: remove export from install script. --- modules/runners/templates/install-runner.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/runners/templates/install-runner.sh b/modules/runners/templates/install-runner.sh index 94e440e265..1a0246eb85 100644 --- a/modules/runners/templates/install-runner.sh +++ b/modules/runners/templates/install-runner.sh @@ -37,9 +37,6 @@ rm -rf $file_name ${ARM_PATCH} -echo "export RUNNER_ALLOW_RUNASROOT=1" -export RUNNER_ALLOW_RUNASROOT=1 - os_id=$(awk -F= '/^ID/{print $2}' /etc/os-release) if [[ "$os_id" =~ ^ubuntu.* ]]; then echo "Installing dependencies" From ed5acbd1f096768dd4f8ece2f2f601ec93987ccd Mon Sep 17 00:00:00 2001 From: Scott Guymer Date: Tue, 21 Dec 2021 09:03:15 +0100 Subject: [PATCH 2/2] Add log line to the run as root export --- modules/runners/templates/start-runner.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/runners/templates/start-runner.sh b/modules/runners/templates/start-runner.sh index 958eb81768..6da70d1f9b 100644 --- a/modules/runners/templates/start-runner.sh +++ b/modules/runners/templates/start-runner.sh @@ -50,12 +50,13 @@ echo "Delete GH Runner token from AWS SSM" aws ssm delete-parameter --name "$environment"-"$instance_id" --region "$region" if [ -z "$run_as" ]; then - echo "No user specified, using default ec2-user account" - run_as="ec2-user" + echo "No user specified, using default ec2-user account" + run_as="ec2-user" fi if [[ "$run_as" == "root" ]]; then - export RUNNER_ALLOW_RUNASROOT=1 + echo "run_as is set to root - export RUNNER_ALLOW_RUNASROOT=1" + export RUNNER_ALLOW_RUNASROOT=1 fi echo "Configure GH Runner as user $run_as"