#cloud-config autoinstall: version: 1 interactive-sections: - network - storage locale: en_US.UTF-8 keyboard: layout: us ssh: allow-pw: true install-server: false late-commands: - curtin in-target --target=/target -- apt-get --purge -y --quiet=2 remove apport bcache-tools btrfs-progs byobu cloud-guest-utils cloud-initramfs-copymods cloud-initramfs-dyn-netconf friendly-recovery fwupd landscape-common lxd-agent-loader ntfs-3g open-vm-tools plymouth plymouth-theme-ubuntu-text popularity-contest screen snapd sosreport tmux ufw - curtin in-target --target=/target -- apt-get -qq update - curtin in-target --target=/target -- apt-get -y install wget gnupg python2.7 openssh-server - curtin in-target --target=/target -- apt-get -qq update - curtin in-target --target=/target -- apt-get -y dist-upgrade - curtin in-target --target=/target -- apt-get --purge -y --quiet=2 autoremove - sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /target/etc/ssh/sshd_config - sed -i 's/ENABLED=1/ENABLED=0/' /target/etc/default/motd-news - sed -i 's|# en_US.UTF-8 UTF-8|en_US.UTF-8 UTF-8|' /target/etc/locale.gen - curtin in-target --target=/target -- locale-gen - ln -fs /dev/null /target/etc/systemd/system/connman.service - ln -fs /dev/null /target/etc/systemd/system/display-manager.service - ln -fs /dev/null /target/etc/systemd/system/motd-news.service - ln -fs /dev/null /target/etc/systemd/system/motd-news.timer - ln -fs /dev/null /target/etc/systemd/system/plymouth-quit-wait.service - ln -fs /dev/null /target/etc/systemd/system/plymouth-start.service - ln -fs /dev/null /target/etc/systemd/system/systemd-resolved.service - ln -fs /usr/share/zoneinfo/Europe/Kiev /target/etc/localtime - rm -f /target/etc/resolv.conf - printf 'nameserver 8.8.8.8\nnameserver 1.1.1.1\noptions timeout:1\noptions attempts:1\noptions rotate\n' > /target/etc/resolv.conf - rm -f /target/etc/update-motd.d/10-help-text - rm -rf /target/root/snap - rm -rf /target/snap - rm -rf /target/var/lib/snapd - rm -rf /target/var/snap - curtin in-target --target=/target -- passwd -q -u root - curtin in-target --target=/target -- passwd -q -x -1 root - curtin in-target --target=/target -- passwd -q -e root - sed -i 's|^root:.:|root:$6$3b873df474b55246$GIpSsujar7ihMzG8urUKpzF9/2yZJhR.msyFRa5ouGXOKRCVszsc4aBcE2yi3IuFVxtAGwrPKin2WAzK3qOtB.:|' /target/etc/shadow - sed -i 's/ext4 defaults/ext4 prjquota,lazytime/g' /target/etc/fstab - findmnt --real -U -n -t ext4 -o source | awk '{system("umount -l "$1)}' - blkid -t TYPE="ext4" -o device | awk '{system("tune2fs -O project,quota -Q prjquota "$1)}' user-data: disable_root: false