matrixtest-IaC/kube-user.tpl

27 lines
676 B
Smarty

#cloud-config
packages:
- chrony
- git
- lvm2
- xfsprogs
write_files:
- path: /etc/chrony/chrony.conf
permissions: "0644"
content: |
%{ for line in split("\n",file("chrony.conf")) ~}
${line}
%{ endfor ~}
owner: root:root
runcmd:
- [ systemctl, enable, chronyd ]
- systemctl restart chronyd
- mkdir -p /usr/lib/snap
- vgcreate snapvg /dev/sdb
- lvcreate -n lvol_snap -l 100%FREE snapvg
- mkfs -t xfs /dev/snapvg/lvol_snap -n ftype=1
- cp -a /etc/fstab /run/fstab.bak
- echo "UUID=$(blkid | grep lvol_snap | cut -d \" -f 2 ) /var/snap xfs defaults 0 0" >> /etc/fstab
- findmnt --verify || cp -a /run/fstab.bak /etc/fstab