Prevent launch config from being overwritten and fix possible substitution problem

This commit is contained in:
2023-11-04 16:14:44 +01:00
parent 54fb96119c
commit 36b2ad85a4
@@ -20,7 +20,7 @@ package_reboot_if_required: true
write_files:
- owner: root:root
content: "${microk8s_config}"
path: /var/snap/microk8s/common/.microk8s.yaml
path: /tmp/.microk8s.yaml
encoding: base64
runcmd:
- printf "[sshd]\nenabled = true\nbanaction = iptables-multiport" > /etc/fail2ban/jail.local
@@ -46,7 +46,9 @@ runcmd:
- apt install /tmp/hc-utils_0.0.4-1_all.deb
- apt-get -y install snapd
- snap install kubectl --classic
- snap install microk8s --channel ${microk8s_channel}
- mkdir -p /var/snap/microk8s/common
- mv /tmp/.microk8s.yaml /var/snap/microk8s/common/.microk8s.yaml
- snap install microk8s --channel "${microk8s_channel}"
- mkdir -p /home/terraform/.kube
- microk8s kubectl config view --raw > /home/terraform/.kube/config
- chown -R terraform:terraform /home/terraform/.kube