A server configuration, deployment and management automation via infrastructure-as-code, using Ansible. ServerForm configures and manages servers using rules defined by a collection of Ansible playbooks and roles.
Install required community Ansible collections from Ansible Galaxy:
ansible-galaxy collection install -r requirements.yml
Supply ServerForm with an Ansible-acceptable inventory file (see Ansible's documentation for inventory) which details your server setup and specify the path via the inventory
argument in ansible.cfg
.
To run a playbook:
ansible-playbook --diff plays/[PLAYBOOK].yml
Here are the roles which have been implemented:
- bmajor: Configures bmajor hosts for bminor servers, which pulls backups from bminor servers via rsnapshot.
- bminor: Specifies backup strategy to bmajor hosts via rsync.
- diskconf: Configures disk by partitioning and formatting, and installs Keith Nash's disk burn-in script and a SMART reporting script which is based on this.
- log2ram: Configures Log2Ram, a ramlog for systemd, to prevent log-writing to SD cards.
- mergerfs: Configures mergerfs, a union filesystem that pools access across multiple drives.
- mpd: Configures MPD, a server-side application for playing music.
- pihole: Configures Pi-hole, a DNS adblocker on ARM-based boards.
- samba: Configures Samba, a network file sharing using SMB protocol.
- softserve: Configures Soft Serve, a lightweight self-hostable commandline-based Git server.
Here are some of wonderful implementations of which I based a lot of my roles on.
- Alex Kretzschmar's Github for his Ansible roles is a wonderful place to start, and I especially based a lot of my mergerfs role on his. Incidentally, his Perfect Media Server series of articles is what inspired me to learn Ansible.
- I learnt Ansible from following Jeff Geerling's wonderful YouTube series on Ansible
- The backup major-minor strategy (i.e. bmajor and bminor roles) using rsnapshot is heavily inspired from Osiell's backup implementation. Also consulted Yannik's implementation, and may implement some fancy backup scripts therein down the road.
- Larry Smith Jr.'s Samba Ansible setup provides the base for the samba role, especially the config file setup.