Skip to content

Commit a56ab34

Browse files
Merge pull request #1 from rfsmart-bcleary/bug/OCOP-1106
Added github url to config.cmd
2 parents b2dc794 + 9a16b63 commit a56ab34

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

modules/runners/runner-config.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ resource "aws_ssm_parameter" "runner_agent_mode" {
1212
tags = local.tags
1313
}
1414

15+
resource "aws_ssm_parameter" "gh_url" {
16+
name = "${var.ssm_paths.root}/${var.ssm_paths.config}/gh_url"
17+
type = "String"
18+
value = var.enable_ephemeral_runners ? "ephemeral" : "persistent"
19+
tags = local.tags
20+
}
21+
1522
resource "aws_ssm_parameter" "jit_config_enabled" {
1623
name = "${var.ssm_paths.root}/${var.ssm_paths.config}/enable_jit_config"
1724
type = "String"

modules/runners/templates/start-runner.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ Write-Host "Retrieved $ssm_config_path/agent_mode parameter - ($agent_mode)"
5454
$token_path=$parameters.where( {$_.Name -eq "$ssm_config_path/token_path"}).value
5555
Write-Host "Retrieved $ssm_config_path/token_path parameter - ($token_path)"
5656

57+
$gh_url=$parameters.where( {$_.Name -eq "$ssm_config_path/gh_url"}).value
58+
Write-Host "Retrieved $ssm_config_path/gh_url parameter - ($gh_url)"
59+
5760

5861
if ($enable_cloudwatch_agent -eq "true")
5962
{
@@ -107,7 +110,7 @@ foreach ($group in @("Administrators", "docker-users")) {
107110
Set-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorAdmin -Value 0 -Force
108111
Write-Host "Disabled User Access Control (UAC)"
109112

110-
$configCmd = ".\config.cmd --unattended --name $runner_name_prefix$InstanceId --work `"_work`" $config"
113+
$configCmd = ".\config.cmd --unattended --url $gh_url --name $runner_name_prefix$InstanceId --work `"_work`" $config"
111114
Write-Host "Configure GH Runner as user $run_as"
112115
Invoke-Expression $configCmd
113116

modules/runners/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,12 @@ variable "runner_log_files" {
392392
default = null
393393
}
394394

395+
variable "gh_url" {
396+
description = "GitHub URL with Org ID included."
397+
type = string
398+
default = null
399+
}
400+
395401
variable "ghes_url" {
396402
description = "GitHub Enterprise Server URL. DO NOT SET IF USING PUBLIC GITHUB"
397403
type = string

0 commit comments

Comments
 (0)