This commit is contained in:
2023-11-28 15:22:53 +01:00
parent 2aba25f5d7
commit c2fdf16e8e
2 changed files with 57 additions and 47 deletions

View File

@@ -27,7 +27,7 @@ resource "null_resource" "get_known" {
count = local.needUser?1:0
triggers = { always_run = "${timestamp()}" }
provisioner "local-exec" {
command = "ssh-keyscan -p ${data.kubernetes_service.gitea-ssh.spec.0.port.0.port} ${data.kubernetes_ingress_v1.gitea.spec[0].rule[0].host} > ${path.module}/known_host.txt"
command = "ssh-keyscan -p ${data.kubernetes_service.gitea-ssh.spec.0.port.0.port} ${var.gitea-ssh-domain!=""?var.gitea-ssh-domain:data.kubernetes_ingress_v1.gitea.spec[0].rule[0].host} > ${path.module}/known_host.txt"
}
}
@@ -53,6 +53,11 @@ resource "kubectl_manifest" "ssh-creds" {
data:
known_hosts: "${data.local_file.known_host[0].content}"
EOF
lifecycle {
ignore_changes = [
yaml_body,
]
}
}
data "kubernetes_secret_v1" "ssh-creds-read" {