#!/bin/bash -x # Installs Prereqs - if Ubuntu or Debian, run "sudo su -" then SKIP TO STEP 4 # 1. RUN "sudo su -" then "passwd pi" to SECURE published password # 2. RUN "raspi-config" to set LOCALISATION OPTIONS # 3. RUN "touch /boot/ssh" to enable incoming SSH after next reboot # 4. RUN THIS SCRIPT: curl d.iiab.io/7.0/prep.txt | sudo bash # 5. REBOOTS AUTOMATICALLY WHEN DONE set -e # Exit on error (avoids snowballing) export DEBIAN_FRONTEND=noninteractive # Bypass interactive q's with defaults apt update apt -y dist-upgrade apt -y clean # Above updates OS for security especially if grep -qi raspbian /etc/*release; then tune2fs -m 1 /dev/mmcblk0p2; fi # If OS is Raspbian, lowers reserve disk space from ~5% to 1% apt -y install git echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" >> /etc/apt/sources.list apt -y install dirmngr apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 # REPEATEDLY RE-RUN THE LINE ABOVE if you face this common error: # "signatures couldn't be verified because the public key is not available" apt update apt -y install ansible # Installs latest Ansible from PPA. Also consider: scripts/ansible-2.7.x reboot