From 22b70cc9f19bbda757228329614fe515a754402b Mon Sep 17 00:00:00 2001 From: Jayden Rasmussen Date: Mon, 29 Jun 2020 09:16:52 -0600 Subject: [PATCH 1/2] feat: added variables in the root module to allow passing in pre and post install userdata --- CHANGELOG.md | 1 + main.tf | 3 +++ variables.tf | 10 ++++++++++ 3 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d326d0bc70..4258158ee9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Added the ability to pass in pre and post install scripts to the userdata script for the EC2 instances ## [0.2.0] - 2020-06-15 diff --git a/main.tf b/main.tf index ad44935f35..4f1bd4cd7a 100644 --- a/main.tf +++ b/main.tf @@ -78,6 +78,9 @@ module "runners" { instance_profile_path = var.instance_profile_path role_path = var.role_path role_permissions_boundary = var.role_permissions_boundary + + userdata_pre_install = var.userdata_pre_install + userdata_post_install = var.userdata_post_install } module "runner_binaries" { diff --git a/variables.tf b/variables.tf index bcf3d72831..e3c26ef6cd 100644 --- a/variables.tf +++ b/variables.tf @@ -155,3 +155,13 @@ variable "kms_key_id" { type = string default = null } +variable "userdata_pre_install" { + type = string + default = "" + description = "Script to be ran before the GitHub Actions runner is installed on the EC2 instances" +} +variable "userdata_post_install" { + type = string + default = "" + description = "Script to be ran after the GitHub Actions runner is installed on the EC2 instances" +} From 1d18097a60b4cd09206f31f802611d8fecd90860 Mon Sep 17 00:00:00 2001 From: Jayden Rasmussen Date: Mon, 29 Jun 2020 09:25:18 -0600 Subject: [PATCH 2/2] fix: formatted the terraform files for PR validation --- main.tf | 4 ++-- variables.tf | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/main.tf b/main.tf index 4f1bd4cd7a..21ea880b14 100644 --- a/main.tf +++ b/main.tf @@ -79,8 +79,8 @@ module "runners" { role_path = var.role_path role_permissions_boundary = var.role_permissions_boundary - userdata_pre_install = var.userdata_pre_install - userdata_post_install = var.userdata_post_install + userdata_pre_install = var.userdata_pre_install + userdata_post_install = var.userdata_post_install } module "runner_binaries" { diff --git a/variables.tf b/variables.tf index e3c26ef6cd..1d26aa76ef 100644 --- a/variables.tf +++ b/variables.tf @@ -156,12 +156,12 @@ variable "kms_key_id" { default = null } variable "userdata_pre_install" { - type = string - default = "" - description = "Script to be ran before the GitHub Actions runner is installed on the EC2 instances" + type = string + default = "" + description = "Script to be ran before the GitHub Actions runner is installed on the EC2 instances" } variable "userdata_post_install" { - type = string - default = "" - description = "Script to be ran after the GitHub Actions runner is installed on the EC2 instances" + type = string + default = "" + description = "Script to be ran after the GitHub Actions runner is installed on the EC2 instances" }