#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 /var/snap - vgcreate snapvg /dev/sdb - lvcreate -n lvol_snap -l 100%FREE snapvg - mkfs -t xfs -n ftype=1 /dev/snapvg/lvol_snap - cp -a /etc/fstab /run/fstab.bak - echo "/dev/snapvg/lvol_snap /var/snap xfs defaults 0 0" >> /etc/fstab - systemctl daemon-reload - findmnt --verify || cp -a /run/fstab.bak /etc/fstab