From b40be8fb6da7cb57430bb55fd2e04db3272c2529 Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Sun, 25 Sep 2022 11:36:28 +0000 Subject: [PATCH] Update terraform.tf, variables.tf, .gitlab-ci.yml --- .gitlab-ci.yml | 10 ++++------ terraform.tf | 2 +- variables.tf | 4 ++++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a06442..bc3e6d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,10 @@ stages: - ansible - destroy +before_script: + - echo "token = \"$token\"" >> terraform.tfvars + - echo "config = \"$CI_PROJECT_DIR\\config\"" >> terraform.tfvars + include: - project: 'developerdurp/yml-templates' ref: 'main' @@ -14,15 +18,9 @@ include: plan production: extends: .plan production - before_script: - - echo "token = \"$token\"" >> terraform.tfvars apply: extends: .apply - before_script: - - echo "token = \"$token\"" >> terraform.tfvars destroy: extends: .destroy - before_script: - - echo "token = \"$token\"" >> terraform.tfvars diff --git a/terraform.tf b/terraform.tf index 2cf03ed..4611209 100644 --- a/terraform.tf +++ b/terraform.tf @@ -34,7 +34,7 @@ resource "linode_lke_cluster" "foobar" { } provider "kubectl" { - config_path = "$CI_PROJECT_DIR/config" + config_path = var.config } data "kubectl_file_documents" "namespace" { diff --git a/variables.tf b/variables.tf index 5b4bcf8..cf5d37d 100644 --- a/variables.tf +++ b/variables.tf @@ -2,6 +2,10 @@ variable "token" { description = "Your Linode API Personal Access Token. (required)" } +variable "config" { + description = "kube config from lke" +} + variable "k8s_version" { description = "The Kubernetes version to use for this cluster. (required)" default = "1.23"