Here, we'll discuss how to provision a freshly imaged SD card to run UniFi Controller software.
Spin-up & SSH into the Vagrant box if you are not using Linux.
vagrant up && vagrant ssh
cd base_image
Run the script with sudo
.
sudo ./init-base.sh
We use Ansible
for this. If you don't have it on your computer, go here
to get it done.
Goto provision
directory & install prerequisites (one-off thing)
ansible-galaxy install -r requirements.yml
Initialise Raspberry Pi
ansible-playbook -i raspberrypi.local, -u pi initialise.yml -k
Run
ansible-playbook -i unifi-controller.local, -u pi initialise_dev.yml -k
ansible-playbook -i unifi-controller.local, -u pi install.yml
ansible-playbook -i unifi-controller.local, -u pi initialise_prod.yml
Just run,
ansible-playbook -i unifi-controller.local, ssh_keyscan.yml
or
ssh-keyscan unifi-controller.local >> ~/.ssh/known_hosts
If you received the following error when trying to connect to the hosts with password (with -k
)
fatal: [raspberrypi.local]: FAILED! => {"msg": "to use the 'ssh' connection type with passwords or pkcs11_provider, you must install the sshpass program"}
then run the following (on Mac),
brew tap esolitos/ipa
brew install sshpass