Skip to content
Bootstrap a (FreeBSD) virtual machine with Ansible
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README
ansible.cfg
bootstrap.yml
config.yml

README

VM bootstrap playbooks

These are the Ansible playbooks I use to bootstrap new FreeBSD VMs for local use.

Usage

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 <ip> with the VM's IP address):

ansible-playbook -i <ip>, --extra-vars @config.yml bootstrap.yml --ask-pass

This will also install OpenMDNS, which will make your VM advertise itself by name over multicast DNS, and lock down root access to the VM again.

You can’t perform that action at this time.