Ansible rulez!
In the last weekend I needed to restore my RasperryPi service box. It is a raspberrypi 2 which mostly make backups of my blogs.
Its microSD card gets corrupted, forcing me a full reinstall. I decided to try to make everything via Ansible.
I have already a strong experience with Saltstack, another software used to remotely manage and control huge pool of hosts. Saltstack is an agent-based solution which needs some "setup" steps, which would be an overkill for configuring a single small pc. It has a lot of concept on its own.
I get impressed on how easy was using Ansible to configure by RaspberryPi box. I got up and running in minutes.
My needs were a bit complex:
- I need to set up a bunch of cron jobs
- I need to mount via fstab some nfs remote
- I need to install a docker daemon and a bunch of support software (like screen, python3 etc)
https://github.com/pmeinhardt/huck-up
and then customized it.
Ansible was running on Window Subsystem for Linux (WSL), a suboptimal choice because of its slow speed, anyway it worked flawless and with minimal effort on the basic Raspberry Raspian image.
To get started on the raspberry, I only need to enable ssh access and change the default pi password (for security reason). Then all the setup was done via Ansible.