Fix Argo CD Gitea SSH access
Homelab Main / deploy (push) Successful in 1m25s
Details
Homelab Main / deploy (push) Successful in 1m25s
Details
This commit is contained in:
parent
80df5624e2
commit
57a6a7283c
|
|
@ -10,7 +10,7 @@ variable "argocd_namespace" {
|
|||
|
||||
variable "gitops_repo_url" {
|
||||
type = string
|
||||
default = "ssh://192.168.100.89:32222/jv/my-homelab-configs.git"
|
||||
default = "ssh://git@192.168.100.89:32222/jv/my-homelab-configs.git"
|
||||
}
|
||||
|
||||
variable "website_image_ref" {
|
||||
|
|
|
|||
|
|
@ -1014,7 +1014,11 @@ repo_target="$${repo_url#ssh://}"
|
|||
repo_target="$${repo_target#*@}"
|
||||
repo_target="$${repo_target%%/*}"
|
||||
repo_host="$${repo_target%%:*}"
|
||||
if [ -z "$${repo_host}" ]; then
|
||||
repo_port="$${repo_target#*:}"
|
||||
if [ "$${repo_port}" = "$${repo_target}" ]; then
|
||||
repo_port="22"
|
||||
fi
|
||||
if [ -z "$${repo_host}" ] || [ -z "$${repo_port}" ]; then
|
||||
echo "Could not determine GitOps SSH host from $${repo_url}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -1025,7 +1029,11 @@ trap 'rm -f "$${known_hosts_file}" "$${known_hosts_sorted}"' EXIT
|
|||
|
||||
kubectl --kubeconfig "${self.triggers.kubeconfig_path}" -n "${self.triggers.namespace}" get configmap argocd-ssh-known-hosts-cm \
|
||||
-o jsonpath='{.data.ssh_known_hosts}' > "$${known_hosts_file}" 2>/dev/null || true
|
||||
if [ "$${repo_port}" = "22" ]; then
|
||||
ssh-keyscan -H "$${repo_host}" >> "$${known_hosts_file}" 2>/dev/null
|
||||
else
|
||||
ssh-keyscan -H -p "$${repo_port}" "$${repo_host}" >> "$${known_hosts_file}" 2>/dev/null
|
||||
fi
|
||||
sort -u "$${known_hosts_file}" > "$${known_hosts_sorted}"
|
||||
kubectl --kubeconfig "${self.triggers.kubeconfig_path}" -n "${self.triggers.namespace}" create configmap argocd-ssh-known-hosts-cm \
|
||||
--from-file=ssh_known_hosts="$${known_hosts_sorted}" \
|
||||
|
|
@ -1555,4 +1563,3 @@ resource "helm_release" "extra_tools" {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ variable "calico_operator_node_name" {
|
|||
|
||||
variable "gitops_repo_url" {
|
||||
type = string
|
||||
default = "ssh://192.168.100.89:32222/jv/my-homelab-configs.git"
|
||||
default = "ssh://git@192.168.100.89:32222/jv/my-homelab-configs.git"
|
||||
}
|
||||
|
||||
variable "gitops_ssh_key_path" {
|
||||
|
|
|
|||
Loading…
Reference in New Issue