Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
  • Loading branch information
atanasdinov committed Jun 27, 2024
1 parent a0c73f9 commit 3cce74b
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 62 deletions.
60 changes: 30 additions & 30 deletions pkg/combustion/templates/k3s-multi-node-installer.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
64 changes: 32 additions & 32 deletions pkg/combustion/templates/rke2-multi-node-installer.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 3cce74b

Please sign in to comment.