VM bootstrap playbooks
These are the Ansible playbooks I use to bootstrap new FreeBSD VMs for local use.
Spin up a minimal install of FreeBSD, creating just a root user. Give the host a unique name. I call mine gary, as I like to use Spongebob Squarepants characters as VM names.
Out of the box, we can't SSH into the instance as root, so start the VM as root and run the following:
sed -E -i '' 's/^#(PermitRootLogin|PasswordAuthentication).*/\1 yes/g' /etc/ssh/sshd_config service sshd restart
This allows us to bootstrap the instance as root.
Take note of the VM's IP address with
ipconfig and run (replacing
with the VM's IP address):
ansible-playbook -i <ip>, --extra-vars @config.yml bootstrap.yml --ask-pass