From 9fc9a47e81b2f560713954a95e0b5298aa2fc982 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Sat, 4 Nov 2023 20:14:53 +0100 Subject: [PATCH] Defer write_files --- .../k8s-cluster/templates/cloud-init-k8s-manager.tftpl | 9 ++++++++- .../k8s-cluster/templates/cloud-init-k8s-worker.tftpl | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/terraform/modules/k8s-cluster/templates/cloud-init-k8s-manager.tftpl b/terraform/modules/k8s-cluster/templates/cloud-init-k8s-manager.tftpl index 33725e2..8021655 100644 --- a/terraform/modules/k8s-cluster/templates/cloud-init-k8s-manager.tftpl +++ b/terraform/modules/k8s-cluster/templates/cloud-init-k8s-manager.tftpl @@ -19,36 +19,43 @@ write_files: content: "${microk8s_config}" path: /run/tmpfiles.d/.microk8s.yaml encoding: base64 + defer: true - owner: root:root content: "${packages_setup}" path: /run/tmpfiles.d/install-packages.sh encoding: base64 + defer: true - owner: root:root content: "${firewall_setup}" path: /run/tmpfiles.d/firewall-setup.sh encoding: base64 + defer: true - owner: root:root content: "${ssh_setup}" path: /run/tmpfiles.d/ssh-setup.sh encoding: base64 + defer: true - owner: root:root content: "${microk8s_setup}" path: /run/tmpfiles.d/microk8s-setup.sh encoding: base64 + defer: true %{ if main_node ~} - owner: root:root content: "${cluster_setup}" path: /run/tmpfiles.d/cluster-setup.sh encoding: base64 - permissions: "0755" + defer: true - owner: root:root content: "${cluster_setup_values}" path: /run/tmpfiles.d/cluster-setup-values.yaml encoding: base64 + defer: true - owner: root:root content: "${argocd_ha_values}" path: /run/tmpfiles.d/argocd-values-ha.yaml encoding: base64 + defer: true %{ endif ~} runcmd: - install /run/tmpfiles.d/*.sh /usr/local/bin diff --git a/terraform/modules/k8s-cluster/templates/cloud-init-k8s-worker.tftpl b/terraform/modules/k8s-cluster/templates/cloud-init-k8s-worker.tftpl index 5369cbe..6591695 100644 --- a/terraform/modules/k8s-cluster/templates/cloud-init-k8s-worker.tftpl +++ b/terraform/modules/k8s-cluster/templates/cloud-init-k8s-worker.tftpl @@ -19,22 +19,27 @@ write_files: content: "${microk8s_config}" path: /run/tmpfiles.d/.microk8s.yaml encoding: base64 + defer: true - owner: root:root content: "${packages_setup}" path: /run/tmpfiles.d/install-packages.sh encoding: base64 + defer: true - owner: root:root content: "${firewall_setup}" path: /run/tmpfiles.d/firewall-setup.sh encoding: base64 + defer: true - owner: root:root content: "${ssh_setup}" path: /run/tmpfiles.d/ssh-setup.sh encoding: base64 + defer: true - owner: root:root content: "${microk8s_setup}" path: /run/tmpfiles.d/microk8s-setup.sh encoding: base64 + defer: true runcmd: - install /run/tmpfiles.d/*.sh /usr/local/bin - /usr/local/bin/install-packages.sh