I ran into a few prbolems setting up Ansible to install and manage onion-router instead of using the shell script and these notes are worth keeping after dealing with various problems.

Power Problems - Random reboots and disconnected USB devices

If you randomly lose your network interface and it reappears without any networking information, it is very likely caused by a "brown out," where insufficient power was being supplied to the RaspberryPi; these can also cause the pi to reboot at random. You can check if this is the case by looking in /var/log/messages for lots of disconnects and reconnects after the initial boot, they will look like:

[ 1240.369033] usb 1-1: USB disconnect, device number 74
[ 1241.469088] usb 1-1: New USB device found, idVendor=0424, idProduct=9512
[ 1241.469141] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 1241.476088] hub 1-1:1.0: USB hub found
[ 1241.476302] hub 1-1:1.0: 3 ports detected

The only way to solve this problem is to use a better wall charger. I recommend a 5v 1200mA adapter or better, sometimes they're labeled "tablet chargers" from a reputable manufacturer. You can read more about this problem (although about a different model) here

apt-get failures

Often times apt-get commands fail due problems steming from "Failed to fetch http://mirrordirector.raspbian.org/..." and unfortunately the only thing you can do about this is update /etc/apt/sources.list to add a mirror closer to you (list here), and hope for the best. I occasionally encounter random bugs related to this and have spent a great deal of time on hunting them down only for them to just disappear on the next playbook run. If it fails and you want to change to a closer mirror, open up /etc/apt/sources.list and comment out the line (add a # to the front of it) deb http://raspbian.raspberrypi.org/raspbian stretch main contrib non-free rpi then add your mirror with the trailing selected repositories, so if you're using stretch and the colo-serv.net mirror, add the following to the bottom of /etc/apt/sources.list

deb http://raspbian.mirror.colo-serv.net/raspbian/ stretch main contrib non-free rpi

Then update your apt repositories by running apt-get update and you should be good to go. Important Note: A lot of their North American mirrors seem to be out of date or completely dead, make sure you look around before adding anything to your sources.list file