Infrastructure as Code (IaC) to setup my home system
- Docker installed on host server
- Docker can be used as non-root user
- Ansible setup on PC:
$ ansible-galaxy collection install community.general
$ ansible-galaxy collection install community.docker
Here are the steps to setup the server using Ansible:
- Establish ssh key-based authentication between your PC and the server.
$ ssh-keygen -t rsa -b 4096
$ ssh-copy-id your_username@myserver
- Clone this repository to your PC..
- Run the following from inside the cloned repository.
Copy the example.envvars.yaml file into envvars.yaml and update the variables as per your setup.
SERVER_PUBLIC_IP
- Public IP of the server to be setup - for Wireguard, get's updated by update_dns cronjob.CLOUDFLARE_API_TOKEN
- Cloudflare API token for DNS updatesFTP_MOUNT
- Mount point for FTP serverJELLYFIN_MEDIA_DIR
- Source of the Jellyfin media directory
Example command to run ansible:
ansible-playbook -i inventory.yml --ask-become-pass -e "@envvars.yaml" tasks/main.yml