#!/usr/bin/env bash apt-get remove --purge snap* lxc* lxd* || true sed -i 's/\(GRUB_CMDLINE_LINUX_DEFAULT=\).*/\1\"\"/g' /target/etc/default/grub update-grub sed -i '/PermitRootLogin / s/ .*/ yes/' /etc/ssh/sshd_config mkdir -p /root/.ssh chmod 0700 /root/.ssh echo "{{ tftp_ssh_key }}" >> /root/.ssh/authorized_keys wget --no-proxy http://{{ tftp_server }}/networking/$(cat /etc/hostname)-bridges.cfg -O /etc/network/interfaces.d/vm-bridges.cfg wget --no-proxy http://{{ tftp_server }}/networking/basic-debian-interface.cfg -O /etc/network/interfaces # Trusty VMs seem to have their interfaces file overwritten after we write to # it, so we make it immutable to ensure no further changes take place # NOTE: We remove the immutable attr in deploy-vms.yml once the instance is up # and accessible. [[ "$(lsb_release -sc)" == "trusty" ]] && chattr +i /etc/network/interfaces cat > /etc/network/if-up.d/post-up-rules <