Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include kubeconfig filename in outputs, make content sensitive #94

Merged
merged 9 commits into from
Dec 9, 2021
4 changes: 4 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
name: Integration Tests
runs-on: ${{ matrix.os }}
env:
TF_VAR_secrets_encryption: false
TF_VAR_metro: "sv"
TF_VAR_ccm_enabled: true
TF_VAR_loadbalancer_type: "kube-vip"
TF_IN_AUTOMATION: 1
TF_VERSION: ${{ matrix.tf }}
TF_VAR_control_plane_node_count: 0
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
*.tfvars
examples/inventory.yaml
examples/main.retry
kubeconfig
metal-key
metal-key.pub
2 changes: 1 addition & 1 deletion modules/controller_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ resource "null_resource" "kubeconfig" {
}

data "local_file" "kubeconfig" {
filename = "${path.root}/kubeconfig"
filename = abspath("${path.root}/kubeconfig")

depends_on = [
null_resource.kubeconfig
Expand Down
12 changes: 9 additions & 3 deletions modules/controller_pool/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ output "controller_addresses" {
# }

output "kubeconfig" {
description = "Kubeconfig for the newly created cluster"
value = data.local_file.kubeconfig
}
description = "Kubeconfig content for the newly created cluster"
value = data.local_file.kubeconfig.content
sensitive = true
}

output "kubeconfig_filename" {
description = "Kubeconfig file for the newly created cluster"
value = data.local_file.kubeconfig.filename
}
8 changes: 7 additions & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ output "kubernetes_api_address" {
output "kubernetes_kubeconfig" {
description = "Kubeconfig for the newly created cluster"
value = module.controllers.kubeconfig
}
sensitive = true
}

output "kubernetes_kubeconfig_file" {
description = "Kubecobnfig file for the newly created cluster"
value = module.controllers.kubeconfig_filename
}