Skip to content

Commit

Permalink
Merge pull request #17 from Andrew8xx8/master
Browse files Browse the repository at this point in the history
Added ability to specify runners to use public subnet
  • Loading branch information
npalm authored Aug 8, 2018
2 parents ada6a4d + b7e04bb commit b304fb7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ All variables and defaults:
| runners_off_peak_timezone | Off peak idle time zone of the runners, will be used in the runner config.toml. | string | `` | no |
| runners_privilled | Runners will run in privilled mode, will be used in the runner config.toml | string | `true` | no |
| runners_root_size | Runnner instance root size in GB. | string | `16` | no |
| runners_use_private_address | Restrict runners to use only private address | string | `true` | no |
| runners_token | Token for the runner, will be used in the runner config.toml | string | - | yes |
| ssh_public_key | Public SSH key used for the gitlab-runner ec2 instance. | string | - | yes |
| subnet_id_gitlab_runner | Subnet used for hosting the gitlab-runner. | string | - | yes |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ data "template_file" "runners" {
runners_off_peak_idle_time = "${var.runners_off_peak_idle_time}"
runners_off_peak_periods = "${var.runners_off_peak_periods}"
runners_root_size = "${var.runners_root_size}"
runners_use_private_address = "${var.runners_use_private_address}"
bucket_user_access_key = "${aws_iam_access_key.cache_user.id}"
bucket_user_secret_key = "${aws_iam_access_key.cache_user.secret}"
bucket_name = "${aws_s3_bucket.build_cache.bucket}"
Expand Down
2 changes: 1 addition & 1 deletion template/runner-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ check_interval = 0
IdleTime = ${runners_idle_time}
MachineDriver = "amazonec2"
MachineName = "runner-%s"
MachineOptions = ["amazonec2-instance-type=${runners_instance_type}", "amazonec2-region=${aws_region}", "amazonec2-vpc-id=${runners_vpc_id}", "amazonec2-subnet-id=${runners_subnet_id}", "amazonec2-private-address-only=true", "amazonec2-request-spot-instance=true", "amazonec2-spot-price=${runners_spot_price_bid}", "amazonec2-security-group=${runners_security_group_name}", "amazonec2-tags=environment,${environment}", "amazonec2-monitoring=${runners_monitoring}", "amazonec2-root-size=${runners_root_size}"]
MachineOptions = ["amazonec2-instance-type=${runners_instance_type}", "amazonec2-region=${aws_region}", "amazonec2-vpc-id=${runners_vpc_id}", "amazonec2-subnet-id=${runners_subnet_id}", "amazonec2-private-address-only=${runners_use_private_address}", "amazonec2-request-spot-instance=true", "amazonec2-spot-price=${runners_spot_price_bid}", "amazonec2-security-group=${runners_security_group_name}", "amazonec2-tags=environment,${environment}", "amazonec2-monitoring=${runners_monitoring}", "amazonec2-root-size=${runners_root_size}"]
OffPeakTimezone = "${runners_off_peak_timezone}"
OffPeakIdleCount = ${runners_off_peak_idle_count}
OffPeakIdleTime = ${runners_off_peak_idle_time}
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ variable "runners_root_size" {
default = 16
}

variable "runners_use_private_address" {
description = "Restrict runners to use only private address"
default = "true"
}

variable "docker_machine_user" {
description = "User name for the user to create spot instances to host docker-machine."
type = "string"
Expand Down

0 comments on commit b304fb7

Please sign in to comment.