From 2db366457d598ab7fa0d86b57b40b12bf1779964 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 27 Feb 2023 13:18:01 +0100 Subject: wip --- terraform/README.md | 3 --- terraform/backend.tf | 12 ------------ terraform/conflatorio-docker/backend.tf | 12 ++++++++++++ terraform/conflatorio-docker/main.tf | 24 +++--------------------- terraform/conflatorio-docker/terragrunt.hcl | 3 +++ terraform/terragrunt.hcl | 17 +++++++++-------- terraform/unifi-controller/backend.tf | 6 +++--- terraform/unifi-controller/main.tf | 16 ++++++---------- terraform/unifi-controller/terragrunt.hcl | 8 ++++++++ 9 files changed, 44 insertions(+), 57 deletions(-) delete mode 100644 terraform/backend.tf create mode 100644 terraform/conflatorio-docker/backend.tf create mode 100644 terraform/conflatorio-docker/terragrunt.hcl diff --git a/terraform/README.md b/terraform/README.md index 825cc94..b9a0add 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -1,8 +1,5 @@ # Setup - # Downloads terraform and plugins - make - # Do this in every new terminal source .settings.sh diff --git a/terraform/backend.tf b/terraform/backend.tf deleted file mode 100644 index d970fc9..0000000 --- a/terraform/backend.tf +++ /dev/null @@ -1,12 +0,0 @@ -# Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa -terraform { - backend "s3" { - bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" - endpoint = "eu-central-1.linodeobjects.com" - key = "./terraform.tfstate" - region = "eu-central-1" - skip_credentials_validation = true - skip_metadata_api_check = true - skip_region_validation = true - } -} diff --git a/terraform/conflatorio-docker/backend.tf b/terraform/conflatorio-docker/backend.tf new file mode 100644 index 0000000..d2de289 --- /dev/null +++ b/terraform/conflatorio-docker/backend.tf @@ -0,0 +1,12 @@ +# Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa +terraform { + backend "s3" { + bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" + key = "conflatorio-docker/terraform.tfstate" + skip_region_validation = true + skip_credentials_validation = true + skip_metadata_api_check = true + region = "eu-central-1" + endpoint = "eu-central-1.linodeobjects.com" + } +} diff --git a/terraform/conflatorio-docker/main.tf b/terraform/conflatorio-docker/main.tf index f4cbb61..8a01be6 100644 --- a/terraform/conflatorio-docker/main.tf +++ b/terraform/conflatorio-docker/main.tf @@ -1,16 +1,6 @@ terraform { required_version = "~> 1.3.5" - backend "s3" { - bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" - key = "conflatorio-docker/terraform.tfstate" - region = "eu-central-1" - skip_region_validation = true - skip_credentials_validation = true - skip_metadata_api_check = true - endpoint = "eu-central-1.linodeobjects.com" - } - required_providers { docker = { source = "kreuzwerker/docker" @@ -32,14 +22,6 @@ data "sops_file_entry" "linode_token" { data_key = "linode_token" } -# docker run -d --name ipv6nat --privileged --network host --restart unless-stopped -v /var/run/docker.sock:/var/run/docker.sock:ro robbertkl/ipv6nat - -# resource "docker_network" "bridge6" { -# name = "bridge6" -# ipv6 = true -# -# ipam_options = { -# "com.docker.network.enable_ipv6" = true -# } -# } - +output "foo" { + value = "foo!" +} diff --git a/terraform/conflatorio-docker/terragrunt.hcl b/terraform/conflatorio-docker/terragrunt.hcl new file mode 100644 index 0000000..e147285 --- /dev/null +++ b/terraform/conflatorio-docker/terragrunt.hcl @@ -0,0 +1,3 @@ +include "root" { + path = find_in_parent_folders() +} diff --git a/terraform/terragrunt.hcl b/terraform/terragrunt.hcl index 74d2de9..e7e5f6a 100644 --- a/terraform/terragrunt.hcl +++ b/terraform/terragrunt.hcl @@ -1,16 +1,17 @@ -remote_state { - backend = "s3" - generate = { - path = "backend.tf" - if_exists = "overwrite_terragrunt" - } - config = { +generate "backend" { + path = "backend.tf" + if_exists = "overwrite_terragrunt" + contents = <