From ea018de0d6c006e6594d5778a2311641f6e8eef0 Mon Sep 17 00:00:00 2001 From: Atanas Dinov Date: Thu, 27 Jun 2024 22:25:54 +0300 Subject: [PATCH] Fix indentation Signed-off-by: Atanas Dinov --- .../templates/k3s-multi-node-installer.sh.tpl | 60 ++++++++--------- .../rke2-multi-node-installer.sh.tpl | 64 +++++++++---------- 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/pkg/combustion/templates/k3s-multi-node-installer.sh.tpl b/pkg/combustion/templates/k3s-multi-node-installer.sh.tpl index befd950d..102c7da2 100644 --- a/pkg/combustion/templates/k3s-multi-node-installer.sh.tpl +++ b/pkg/combustion/templates/k3s-multi-node-installer.sh.tpl @@ -32,36 +32,36 @@ umount /var CONFIGFILE={{ .configFilePath }}/$NODETYPE.yaml if [ "$HOSTNAME" = {{ .initialiser }} ]; then - CONFIGFILE={{ .configFilePath }}/{{ .initialiserConfigFile }} - - {{- if .manifestsPath }} - mkdir -p /opt/k8s/manifests - cp {{ .manifestsPath }}/* /opt/k8s/manifests/ - - cat <<- EOF > /etc/systemd/system/kubernetes-resources-install.service - [Unit] - Description=Kubernetes Resources Install - Requires=k3s.service - After=k3s.service - ConditionPathExists=/opt/bin/kubectl - ConditionPathExists=/etc/rancher/k3s/k3s.yaml - - [Install] - WantedBy=multi-user.target - - [Service] - Type=oneshot - Restart=on-failure - RestartSec=30 - ExecStart=/opt/bin/kubectl apply -f /opt/k8s/manifests --kubeconfig=/etc/rancher/k3s/k3s.yaml - # Disable the service and clean up - ExecStartPost=/bin/sh -c "systemctl disable kubernetes-resources-install.service" - ExecStartPost=rm -f /etc/systemd/system/kubernetes-resources-install.service - ExecStartPost=rm -rf /opt/k8s - EOF - - systemctl enable kubernetes-resources-install.service - {{- end }} +CONFIGFILE={{ .configFilePath }}/{{ .initialiserConfigFile }} + +{{ if .manifestsPath }} +mkdir -p /opt/k8s/manifests +cp {{ .manifestsPath }}/* /opt/k8s/manifests/ + +cat <<- EOF > /etc/systemd/system/kubernetes-resources-install.service +[Unit] +Description=Kubernetes Resources Install +Requires=k3s.service +After=k3s.service +ConditionPathExists=/opt/bin/kubectl +ConditionPathExists=/etc/rancher/k3s/k3s.yaml + +[Install] +WantedBy=multi-user.target + +[Service] +Type=oneshot +Restart=on-failure +RestartSec=30 +ExecStart=/opt/bin/kubectl apply -f /opt/k8s/manifests --kubeconfig=/etc/rancher/k3s/k3s.yaml +# Disable the service and clean up +ExecStartPost=/bin/sh -c "systemctl disable kubernetes-resources-install.service" +ExecStartPost=rm -f /etc/systemd/system/kubernetes-resources-install.service +ExecStartPost=rm -rf /opt/k8s +EOF + +systemctl enable kubernetes-resources-install.service +{{- end }} fi {{- if and .apiVIP .apiHost }} diff --git a/pkg/combustion/templates/rke2-multi-node-installer.sh.tpl b/pkg/combustion/templates/rke2-multi-node-installer.sh.tpl index e1462ce6..8e13501d 100644 --- a/pkg/combustion/templates/rke2-multi-node-installer.sh.tpl +++ b/pkg/combustion/templates/rke2-multi-node-installer.sh.tpl @@ -32,38 +32,38 @@ umount /var CONFIGFILE={{ .configFilePath }}/$NODETYPE.yaml if [ "$HOSTNAME" = {{ .initialiser }} ]; then - CONFIGFILE={{ .configFilePath }}/{{ .initialiserConfigFile }} - - {{- if .manifestsPath }} - mkdir -p /opt/k8s/manifests - cp {{ .manifestsPath }}/* /opt/k8s/manifests/ - - cat <<- EOF > /etc/systemd/system/kubernetes-resources-install.service - [Unit] - Description=Kubernetes Resources Install - Requires=rke2-server.service - After=rke2-server.service - ConditionPathExists=/var/lib/rancher/rke2/bin/kubectl - ConditionPathExists=/etc/rancher/rke2/rke2.yaml - - [Install] - WantedBy=multi-user.target - - [Service] - Type=oneshot - Restart=on-failure - RestartSec=30 - # Copy kubectl in order to avoid SELinux permission issues - ExecStartPre=cp /var/lib/rancher/rke2/bin/kubectl /opt/k8s/kubectl - ExecStart=/opt/k8s/kubectl apply -f /opt/k8s/manifests --kubeconfig /etc/rancher/rke2/rke2.yaml - # Disable the service and clean up - ExecStartPost=/bin/sh -c "systemctl disable kubernetes-resources-install.service" - ExecStartPost=rm -f /etc/systemd/system/kubernetes-resources-install.service - ExecStartPost=rm -rf /opt/k8s - EOF - - systemctl enable kubernetes-resources-install.service - {{- end }} +CONFIGFILE={{ .configFilePath }}/{{ .initialiserConfigFile }} + +{{ if .manifestsPath }} +mkdir -p /opt/k8s/manifests +cp {{ .manifestsPath }}/* /opt/k8s/manifests/ + +cat <<- EOF > /etc/systemd/system/kubernetes-resources-install.service +[Unit] +Description=Kubernetes Resources Install +Requires=rke2-server.service +After=rke2-server.service +ConditionPathExists=/var/lib/rancher/rke2/bin/kubectl +ConditionPathExists=/etc/rancher/rke2/rke2.yaml + +[Install] +WantedBy=multi-user.target + +[Service] +Type=oneshot +Restart=on-failure +RestartSec=30 +# Copy kubectl in order to avoid SELinux permission issues +ExecStartPre=cp /var/lib/rancher/rke2/bin/kubectl /opt/k8s/kubectl +ExecStart=/opt/k8s/kubectl apply -f /opt/k8s/manifests --kubeconfig /etc/rancher/rke2/rke2.yaml +# Disable the service and clean up +ExecStartPost=/bin/sh -c "systemctl disable kubernetes-resources-install.service" +ExecStartPost=rm -f /etc/systemd/system/kubernetes-resources-install.service +ExecStartPost=rm -rf /opt/k8s +EOF + +systemctl enable kubernetes-resources-install.service +{{- end }} fi {{- if .apiHost }}