Automated configuration of systems running MacOS or Raspbian Linux
- Apple system with the latest MacOS installed
- Raspberry Pi 2, 3 or 4 with Raspbian OS installed
git clone https://github.com/stuvie/devops.git
cd devops
- read and customize the scripts in the
bin
folder - read and customize the config files in the
files
folder, certainlyhosts
,resolv.conf
anddhcpcd.conf
Generally, everything you'd want to customize is at the top of each script
sudo ./bin/step1 HOSTNAME IP_ADDRESS
For example:
sudo ./bin/step1 pi0.fywss.com 10.20.1.40 | tee step1.out
sudo ./bin/step1 pi2.fywss.com 10.20.1.42 | tee step1.out
sudo ./bin/step1 pi3.fywss.com 10.20.1.43 | tee step1.out
sudo ./bin/step1 pie.fywss.com 10.20.20.2 | tee step1.out
sudo ./bin/step1 berry.fywss.com dhcp | tee step1.out
This script will make a backup copy of /etc
under /bak/fresh
, create an admin user account (steve, by default) and improve the security of your ssh service by disabling password authentication.
On Linux, it will also install core utilities via apt-get
and setup a static IP address. When complete, reboot. Make sure system comes up with the correct hostname and IP address.
On MacOS, step2 installs packages via brew
, which must not be run as root:
./bin/step2
On Linux, step2 installs packages for configuring and monitoring a system:
sudo ./bin/step2
When complete, you can configure nginx, prometheus, etc.
After step2, the system should be configured via ansible.
Modify the inventory
file to suit your environment. Change the hostnames to your liking.
If your SSH user on the Raspberry Pis are not the Raspbian default pi
user modify remote_user
in the ansible.cfg
.
ansible -m ping all
ansible -m ping master
ansible-playbook common.yml
ansible-playbook toys.yml
ansible-playbook debug.yml
- expand ansible playbooks
- nginx ssl config should use template
- add support for other operating systems
- monitoring tools configuration