Ansible playbook for automating server deployment.
This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
2022-04-05 20:42:12 -04:00
group_vars/all Add gateway setting to nmcli 2022-03-06 19:36:53 -05:00
roles Fix gitea unit file 2022-04-05 20:42:12 -04:00
tasks Bootstrap Python onto the system 2022-03-04 07:30:52 -05:00
.gitignore Reorganise file structure into roles 2022-03-01 17:43:44 -05:00
ansible.cfg Initial file upload 2022-02-27 16:05:34 -05:00
hosts.example Make process generally smoother 2022-03-02 19:58:31 -05:00
README.md Allow not having a Synapse signing key 2022-03-04 13:17:09 -05:00
run.yml Add tags to playbook 2022-03-19 14:54:24 -04:00

Homeserver Ansible playbook

This is the Ansible playbook I use to automate installation and configuration of the services on my homeserver. Do note that this is for personal use, so do not rely on this repo for anything important.

The playbook assumes you have Arch Linux ARM installed on a machine in your LAN, connected to ethernet. It should have default credentials (alarm - alarm, root - root). Installation of Python and use of pacman-key is handled.

Special thanks to Wolfgang for the idea of automating the installation process. This project was largely inspired by his own infra repo.

Services

  • Gitea
  • Exim mailserver (for local use only)
  • Matrix Synapse
  • Nginx webserver
  • MediaWiki farm
  • SFTP (not really a service, included in sshd)
  • Firewall (UFW)

Miscellaneous features

  • Bootstrapping Python
  • Setting up a LAN static IP address (NetworkManager)
  • Filesystem decryption and mounting
  • Dotfile installation

Usage

Install ansible. Install guide

Clone the repo:

git clone https://github.com/dogeystamp/homeserver-ansible

Create a hosts file based on hosts.example:

cd homeserver-ansible
cp hosts.example hosts
vim hosts

Adjust group variables (remember this is for all your hosts):

vim group_vars/all/vars.yml

Adjust host variables:

mkdir -p host_vars/[hostname]/
vim host_vars/[hostname]/vars.yml

Create vault for secrets:

ansible-vault create host_vars/[hostname]/vault.yml
ansible-vault edit host_vars/[hostname]/vault.yml

A template for secret variables can be found near the end of group_vars/all/vars.yml

Add secret files:

# Keyfile for LUKS disk encryption
dd if=/dev/random of=roles/filesystems/files/k5e.secret bs=1024 count=2
ansible-vault encrypt roles/filesystems/files/k5e.secret

# This is a signing key for Matrix Synapse. It should be from a previous install.
# If you don't have one, it should be generated by Synapse.
ansible-vault encrypt roles/services/synapse/files/signing.key.secret