Provide variables file for non-ha argo cd as well

This commit is contained in:
2023-11-06 07:56:47 +01:00
parent d38d3f12c3
commit 13d8ca1e7f
4 changed files with 7 additions and 1 deletions
@@ -115,6 +115,7 @@ resource "hcloud_server" "manager" {
allowed_namespaces : var.vault_allowed_namespaces allowed_namespaces : var.vault_allowed_namespaces
})) }))
argocd_ha_values : base64encode(file("${path.module}/templates/helm/argocd-values-ha.yaml")) argocd_ha_values : base64encode(file("${path.module}/templates/helm/argocd-values-ha.yaml"))
argocd_values : base64encode(file("${path.module}/templates/helm/argocd-values.yaml"))
cluster_setup : base64encode(templatefile("${path.module}/templates/scripts/cluster-setup.sh", { cluster_setup : base64encode(templatefile("${path.module}/templates/scripts/cluster-setup.sh", {
argocd_environment : var.argocd_environment argocd_environment : var.argocd_environment
argocd_version : var.argocd_chart_version argocd_version : var.argocd_chart_version
@@ -61,6 +61,11 @@ write_files:
path: /run/tmpfiles.d/argocd-values-ha.yaml path: /run/tmpfiles.d/argocd-values-ha.yaml
encoding: base64 encoding: base64
defer: true defer: true
- owner: root:root
content: "${argocd_values}"
path: /run/tmpfiles.d/argocd-values.yaml
encoding: base64
defer: true
%{ endif ~} %{ endif ~}
runcmd: runcmd:
- install /run/tmpfiles.d/*.sh /usr/local/bin - install /run/tmpfiles.d/*.sh /usr/local/bin
@@ -16,6 +16,6 @@ chown -R ${admin_user}:${admin_user} /home/${admin_user}/.kube
%{ if high_availability ~} %{ if high_availability ~}
/snap/bin/microk8s.helm3 install argo-cd argo/argo-cd --create-namespace -n argocd --values /run/tmpfiles.d/argocd-values-ha.yaml /snap/bin/microk8s.helm3 install argo-cd argo/argo-cd --create-namespace -n argocd --values /run/tmpfiles.d/argocd-values-ha.yaml
%{ else ~} %{ else ~}
/snap/bin/microk8s.helm3 install argo-cd argo/argo-cd --create-namespace -n argocd /snap/bin/microk8s.helm3 install argo-cd argo/argo-cd --create-namespace -n argocd --values /run/tmpfiles.d/argocd-values.yaml
%{ endif ~} %{ endif ~}
/snap/bin/microk8s.helm3 install argocd-config 2martens/argocd-configuration -n argocd --version ${argocd_version} --set environment=${argocd_environment} /snap/bin/microk8s.helm3 install argocd-config 2martens/argocd-configuration -n argocd --version ${argocd_version} --set environment=${argocd_environment}