A Ansible Playbook for deploying Arch / Debian workstation
I have setup a few workstations over the years and for one reason or another but never formailsed their configs. It's finally time to put an end to that. formalize their configs and make all the DNS/ad-blocking/monitoring stuff encapsulated into one Ansible project.
So that's what this is.
Ansible: Installs Prometheus and Grafana, along with a few Docker containers to monitor your Internet connection with Speedtest.net speedtests and HTTP tests so you can see uptime, ping stats, and speedtest results over time.
IMPORTANT NOTE: If you use the included Internet monitoring, it will download a decently-large amount of data through your Internet connection on a daily basis. Don't use it, or tune the internet-monitoring
setup to not run the speedtests as often, if you have a metered connection!
You should use a Raspberry Pi 4 model B or better. The Pi 4 and later generations of Pi include a full gigabit network interface and enough I/O to reliably measure fast Internet connections.
Older Pis work, but have many limitations, like a slower CPU and sometimes very-slow NICs that limit the speed test capability to 100 Mbps or 300 Mbps on the Pi 3 model B+.
Other computers and VMs may run this configuration as well, but it is only regularly tested on a Raspberry Pi.
The configuration is tested against Raspberry Pi OS, both 64-bit and 32-bit, and runs great on that or a generic Debian installation.
It should also work with Ubuntu for Pi, or Arch Linux, but has not been tested on other operating systems.
- Install Ansible. The easiest way (especially on Pi or a Debian system) is via Pip:
- (On Arch):
sudo pacman -S ansible
- (Other):
pip3 install ansible
- (On Arch):
- Clone this repository:
git clone https://github.com/andronics/workstation.git
, then enter the repository directory:cd workstation
. - Install requirements:
ansible-galaxy collection install -r requirements.yml
(if you seeansible-galaxy: command not found
, restart your SSH session or reboot the Workstation and try again) - Make copies of the following files and customize them to your liking:
example.inventory.ini
toinventory.ini
(replace IP address with your Pi's IP, or comment that line and uncomment theconnection=local
line if you're running it on the Pi you're setting up).example.config.yml
toconfig.yml
- Run the playbook:
ansible-playbook main.yml
If running locally on the Pi: You may encounter an error like "Error while fetching server API version". If you do, please either reboot or log out and log back in, then run the playbook again.
Visit the Pi's IP address
- Deluge (http://deluge.local/)
- Jackett (http://jackett.local/)
- Lidarr (http://lidarr.local/)
- Radarr (http://radarr.local/)
- Sonarr (http://sonarr.local/)
To upgrade Workstation to the latest version, run the following commands:
cd ~/workstation #
docker-compose pull # pulls the latest images
docker-compose up -d --no-deps # restarts containers with newer images
docker system prune --all # deletes unused images
Upgrades for the other configurations are similar (go into the directory, and run the same docker-compose
commands. Make sure to cd
into the config_dir
that you use in your config.yml
file.
At some point in the future, a dedicated upgrade playbook may be added, but for now, upgrades may be performed manually as shown above.
A guide for backing up the configurations and historical data will be posted here as part of Issue #194: Create Backup guide.
MIT
This project was created in 2021 by Stephen Cox.