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" 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"