Skip to content

Commit

Permalink
Merge branch 'release/3.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
npalm committed Jun 5, 2019
2 parents 0409bb8 + b71a8f0 commit c8af924
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 56 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [3.3.0] - 2019-06-06
- Changed:
- Update default runner type, GitLab runner version, and versions in examples.
- Buffix #75 runner is not reachable when runners_use_private_address = false
- Buffix - Missing typ - @Orkin
- Bugfix #72 - Detect and retry when docker machine download fails eliasdorneles
- Bugfix #68 - add count to prevent resource creation failing @philippefuentes
- Bugfix #70 - update policy to allow runners to start when not using spot instances @philippefuentes

## [3.3.0] - 2019-05-20
- Changed: Default version of GitLab runner set to 11.10.1
- Added: Option to enable / disable SSH login
Expand Down Expand Up @@ -116,7 +126,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Update default AMI's to The latest Amazon Linux AMI 2017.09.1 - released on 2018-01-17.
- Minor updates in the example

[Unreleased]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/3.3.0...HEAD
[Unreleased]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/3.4.0...HEAD
[3.4.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/3.3.0...3.4.0
[3.3.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/3.2.0...3.3.0
[3.2.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/3.1.0...3.2.0
[3.1.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/3.0.0...3.1.0
Expand Down
2 changes: 1 addition & 1 deletion examples/runner-default/.terraform-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.13
0.11.14
4 changes: 3 additions & 1 deletion examples/runner-default/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "1.60.0"
version = "1.66.0"

name = "vpc-${var.environment}"
cidr = "10.0.0.0/16"
Expand Down Expand Up @@ -33,6 +33,8 @@ module "runner" {
runners_name = "${var.runner_name}"
runners_gitlab_url = "${var.gitlab_url}"

docker_machine_spot_price_bid = "0.06"

gitlab_runner_registration_config = {
registration_token = "${var.registration_token}"
tag_list = "docker_spot_runner"
Expand Down
10 changes: 5 additions & 5 deletions examples/runner-default/providers.tf
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
provider "aws" {
region = "${var.aws_region}"
version = "2.4"
version = "2.13"
}

provider "template" {
version = "2.1"
version = "2.1.2"
}

provider "local" {
version = "1.2"
version = "1.2.2"
}

provider "null" {
version = "2.1"
version = "2.1.2"
}

provider "tls" {
version = "1.2"
version = "2.0.1"
}
2 changes: 1 addition & 1 deletion examples/runner-docker/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "1.59.0"
version = "1.66.0"

name = "vpc-${var.environment}"
cidr = "10.1.0.0/16"
Expand Down
10 changes: 5 additions & 5 deletions examples/runner-docker/providers.tf
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
provider "aws" {
region = "${var.aws_region}"
version = "2.4"
version = "2.13"
}

provider "template" {
version = "2.1"
version = "2.1.2"
}

provider "local" {
version = "1.2"
version = "1.2.2"
}

provider "null" {
version = "2.1"
version = "2.1.2"
}

provider "tls" {
version = "1.2"
version = "2.0.1"
}
2 changes: 1 addition & 1 deletion examples/runner-public/.terraform-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.13
0.11.14
9 changes: 5 additions & 4 deletions examples/runner-public/main.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "1.60.0"
version = "1.66.0"

name = "vpc-${var.environment}"
cidr = "10.1.0.0/16"

azs = ["eu-west-1b"]
public_subnets = ["10.1.101.0/24"]

map_public_ip_on_launch = "false"

tags = {
Environment = "${var.environment}"
}
Expand All @@ -19,16 +21,15 @@ module "runner" {
aws_region = "${var.aws_region}"
environment = "${var.environment}"

ssh_public_key = "${local_file.public_ssh_key.content}"

ssh_public_key = "${local_file.public_ssh_key.content}"
runners_use_private_address = false

vpc_id = "${module.vpc.vpc_id}"
subnet_ids_gitlab_runner = "${module.vpc.public_subnets}"
subnet_id_runners = "${element(module.vpc.public_subnets, 0)}"
aws_zone = "b"

runner_instance_spot_price = "0.006"
docker_machine_spot_price_bid = "0.1"

runners_name = "${var.runner_name}"
runners_gitlab_url = "${var.gitlab_url}"
Expand Down
10 changes: 5 additions & 5 deletions examples/runner-public/providers.tf
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
provider "aws" {
region = "${var.aws_region}"
version = "2.4"
version = "2.13"
}

provider "template" {
version = "2.1"
version = "2.1.2"
}

provider "local" {
version = "1.2"
version = "1.2.2"
}

provider "null" {
version = "2.1"
version = "2.1.2"
}

provider "tls" {
version = "1.2"
version = "2.0.1"
}
8 changes: 5 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ resource "aws_autoscaling_group" "gitlab_runner_instance" {
launch_configuration = "${aws_launch_configuration.gitlab_runner_instance.name}"

tags = [
"${concat(
data.null_data_source.tags.*.outputs,
"${concat(
data.null_data_source.tags.*.outputs,
list(map("key", "Name", "value", local.name_runner_instance, "propagate_at_launch", true)))}",
]
}
Expand All @@ -215,7 +215,7 @@ resource "aws_launch_configuration" "gitlab_runner_instance" {
spot_price = "${var.runner_instance_spot_price}"
iam_instance_profile = "${aws_iam_instance_profile.instance.name}"

associate_public_ip_address = false
associate_public_ip_address = "${!var.runners_use_private_address}"

lifecycle {
create_before_destroy = true
Expand Down Expand Up @@ -346,6 +346,8 @@ resource "aws_iam_policy" "ssm" {
}

resource "aws_iam_role_policy_attachment" "ssm" {
count = "${var.enable_manage_gitlab_token ? 1 : 0}"

role = "${aws_iam_role.instance.name}"
policy_arn = "${aws_iam_policy.ssm.arn}"
}
51 changes: 26 additions & 25 deletions policies/instance-docker-machine-policy.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:DescribeKeyPairs",
"ec2:TerminateInstances",
"ec2:StopInstances",
"ec2:StartInstances",
"ec2:RebootInstances",
"ec2:CreateKeyPair",
"ec2:DeleteKeyPair",
"ec2:ImportKeyPair",
"ec2:Describe*",
"ec2:CreateTags",
"ec2:RequestSpotInstances",
"ec2:CancelSpotInstanceRequests",
"ec2:DescribeSubnets",
"ec2:AssociateIamInstanceProfile",
"iam:PassRole"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:DescribeKeyPairs",
"ec2:TerminateInstances",
"ec2:StopInstances",
"ec2:StartInstances",
"ec2:RunInstances",
"ec2:RebootInstances",
"ec2:CreateKeyPair",
"ec2:DeleteKeyPair",
"ec2:ImportKeyPair",
"ec2:Describe*",
"ec2:CreateTags",
"ec2:RequestSpotInstances",
"ec2:CancelSpotInstanceRequests",
"ec2:DescribeSubnets",
"ec2:AssociateIamInstanceProfile",
"iam:PassRole"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
2 changes: 1 addition & 1 deletion template/gitlab-runner.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fi

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | bash
yum install gitlab-runner-${gitlab_runner_version} -y
curl -L https://github.com/docker/machine/releases/download/v${docker_machine_version}/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && \
curl --fail --retry 6 -L https://github.com/docker/machine/releases/download/v${docker_machine_version}/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && \
chmod +x /tmp/docker-machine && \
cp /tmp/docker-machine /usr/local/bin/docker-machine && \
ln -s /usr/local/bin/docker-machine /usr/bin/docker-machine
Expand Down
7 changes: 4 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ variable "ssh_public_key" {

variable "docker_machine_instance_type" {
description = "Instance type used for the instances hosting docker-machine."
default = "m5.large"
default = "m5a.large"
}

variable "docker_machine_spot_price_bid" {
description = "Spot price bid."
default = "0.04"
default = "0.06"
}

variable "docker_machine_version" {
Expand Down Expand Up @@ -239,7 +239,7 @@ variable "cache_shared" {
variable "gitlab_runner_version" {
description = "Version of the GitLab runner."
type = "string"
default = "11.10.1"
default = "11.11.2"
}

variable "enable_gitlab_runner_ssh_access" {
Expand Down Expand Up @@ -334,6 +334,7 @@ variable "name_runners_docker_machine" {

variable "overrides" {
description = "This maps provides the possibility to override some defaults. The following attributes are supported: `name_sg` overwrite the `Name` tag for all security groups created by this module. `name_runner_agent_instance` override the `Name` tag for the ec2 instance defined in the auto launch configuration. `name_docker_machine_runners` ovverrid the `Name` tag spot instances created by the runner agent."
type = "map"

default = {
name_sg = ""
Expand Down

0 comments on commit c8af924

Please sign in to comment.