#cloud-config packages: - chrony - git - lvm2 - xfsprogs write_files: - path: /etc/chrony/chrony.conf permissions: "0644" content: | {{ lookup('ansible.builtin.file', 'chrony.conf') | indent(6, False ) }} owner: root:root runcmd: - [ systemctl, enable, chronyd ] - systemctl restart chronyd - mkdir -p /var/snap - timeout 60 /bin/bash -c 'until ls /dev/sdb 2>/dev/null;do sleep 1;done' - 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 - mount /var/snap