Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions images/linux-amzn2/github_agent.linux.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ variable "root_volume_size_gb" {
default = 8
}

variable "ebs_delete_on_termination" {
description = "Indicates whether the EBS volume is deleted on instance termination."
type = bool
default = true
}

variable "global_tags" {
description = "Tags to apply to everything"
type = map(string)
Expand Down Expand Up @@ -91,9 +97,10 @@ source "amazon-ebs" "githubrunner" {


launch_block_device_mappings {
device_name = "/dev/xvda"
volume_size = "${var.root_volume_size_gb}"
volume_type = "gp3"
device_name = "/dev/xvda"
volume_size = "${var.root_volume_size_gb}"
volume_type = "gp3"
delete_on_termination = "${var.ebs_delete_on_termination}"
}
}

Expand Down Expand Up @@ -151,4 +158,4 @@ build {
]
}

}
}
15 changes: 11 additions & 4 deletions images/ubuntu-focal/github_agent.ubuntu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ variable "root_volume_size_gb" {
default = 8
}

variable "ebs_delete_on_termination" {
description = "Indicates whether the EBS volume is deleted on instance termination."
type = bool
default = true
}

variable "global_tags" {
description = "Tags to apply to everything"
type = map(string)
Expand Down Expand Up @@ -90,9 +96,10 @@ source "amazon-ebs" "githubrunner" {
)

launch_block_device_mappings {
device_name = "/dev/sda1"
volume_size = "${var.root_volume_size_gb}"
volume_type = "gp3"
device_name = "/dev/sda1"
volume_size = "${var.root_volume_size_gb}"
volume_type = "gp3"
delete_on_termination = "${var.ebs_delete_on_termination}"
}
}

Expand Down Expand Up @@ -161,4 +168,4 @@ build {
]
}

}
}
13 changes: 12 additions & 1 deletion images/windows-core-2019/github_agent.windows.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ variable "region" {
default = "eu-west-1"
}

variable "ebs_delete_on_termination" {
description = "Indicates whether the EBS volume is deleted on instance termination."
type = bool
default = true
}

source "amazon-ebs" "githubrunner" {
ami_name = "github-runner-windows-core-2019-${formatdate("YYYYMMDDhhmm", timestamp())}"
communicator = "winrm"
Expand All @@ -43,6 +49,11 @@ source "amazon-ebs" "githubrunner" {
winrm_port = 5986
winrm_use_ssl = true
winrm_username = "Administrator"

launch_block_device_mappings {
device_name = "/dev/sda1"
delete_on_termination = "${var.ebs_delete_on_termination}"
}
}

build {
Expand All @@ -63,4 +74,4 @@ build {
action_runner_url = var.action_runner_url
})]
}
}
}