Skip to content

Igortorrente/SelfHost-Playbook

Repository files navigation

SelfHost Playbook

SelfHost is a ansible playbook to install, configure, and integrate a series of services. It is intended for a homelab with flexibility and easy of use in mind.

Here we use rootless docker containers to make the things more easily reproducible, upgradable, fast and secure. The only rootfull container is the nginx-proxy container that requires access to the privileged ports.

All services used in this playbook are FLOSS.

Services

Supported O.S.

  • Debian 12 (Tested)
  • Ubuntu 22.04/20.04 (Not tested but probably works)

How to test/develop

This repository contains the molecule files to test the playbook. The easiest way to setup the development environment is using python venv.

The molecule is configured to use vagrant, so lets install it first.

sudo apt install vagrant vagrant-libvirt libvirt-daemon-system

Install Venv and python netaddr.

sudo apt install python3-venv python3-netaddr

Setup and enter the Virtual environment:

python3 -m venv python3_venv
source python3_venv/bin/activate

Install the python packges:

pip3 install yamllint ansible-lint ansible 'molecule-plugins[vagrant]' netaddr

And run the molecule inside the project folder:

molecule test

How to run

  1. First you need add your server IP in the inventory file.

  2. Change user_vars.yaml configuration for your needs.

    Don't forget to add the passwords If you need rerun this playbook on an already configured server

  3. Install some packages.

sudo apt install ansible python3-netaddr
  1. Install the ansible-galaxy collections
ansible-galaxy install -r requirements.yml
  1. And then run the playbook:
ansible-playbook -u <remote-user> -i inventory main.yml