From 6a4c19b314ef54d11bf8ab12cd682c6fe9222ad9 Mon Sep 17 00:00:00 2001 From: developerdurp Date: Sat, 25 Nov 2023 19:58:18 -0600 Subject: [PATCH] update --- .gitignore | 1 + TERRAFORM.GITLAB.PROJECTS/main.tf | 4 +++- TERRAFORM.GITLAB.PROJECTS/variables.tf | 7 +++---- TERRAFORM.OCTOPUS.PROJECTS/main.tf | 13 +++++++++++++ 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 TERRAFORM.OCTOPUS.PROJECTS/main.tf diff --git a/.gitignore b/.gitignore index c14a3ad..e13a85b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .terraform* .env +*.tfstate* diff --git a/TERRAFORM.GITLAB.PROJECTS/main.tf b/TERRAFORM.GITLAB.PROJECTS/main.tf index a35483f..2c4ae71 100644 --- a/TERRAFORM.GITLAB.PROJECTS/main.tf +++ b/TERRAFORM.GITLAB.PROJECTS/main.tf @@ -1,5 +1,5 @@ terraform { - backend "http" {} + #backend "http" {} required_providers { gitlab = { source = "gitlabhq/gitlab" @@ -41,11 +41,13 @@ resource "gitlab_branch_protection" "release" { } resource "gitlab_project_runner_enablement" "k3s" { + count = var.GITLAB_SHARED_RUNNER_ID != 0 ? 1 : 0 project = gitlab_project.project.id runner_id = var.GITLAB_SHARED_RUNNER_ID } resource "gitlab_project_variable" "OCTOAPI" { + count = var.OCTOAPI != "" ? 1 : 0 project = gitlab_project.project.id key = "OCTOAPI" value = var.OCTOAPI diff --git a/TERRAFORM.GITLAB.PROJECTS/variables.tf b/TERRAFORM.GITLAB.PROJECTS/variables.tf index b17de0c..e638c44 100644 --- a/TERRAFORM.GITLAB.PROJECTS/variables.tf +++ b/TERRAFORM.GITLAB.PROJECTS/variables.tf @@ -2,18 +2,17 @@ variable "GITLAB_TOKEN" { type = string } -variable "GITLAB_PROJECT_ID" { - type = number -} - variable "GITLAB_PROJECT_NAME" { type = string } variable "GITLAB_SHARED_RUNNER_ID" { type = number + default = 0 } variable "OCTOAPI" { type = string + default = "" } + diff --git a/TERRAFORM.OCTOPUS.PROJECTS/main.tf b/TERRAFORM.OCTOPUS.PROJECTS/main.tf new file mode 100644 index 0000000..32a7269 --- /dev/null +++ b/TERRAFORM.OCTOPUS.PROJECTS/main.tf @@ -0,0 +1,13 @@ +terraform { + required_providers { + octopusdeploy = { + source = "OctopusDeployLabs/octopusdeploy" + version = "0.13.3" + } + } +} + +provider "octopusdeploy" { + # Configuration options +} +