From ce5e188654016843aefecb73ff929855931de92b Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Sun, 16 Jan 2022 22:33:45 +0700 Subject: [PATCH] docs: use new configure script --- configure.py | 2 +- docs/src/deployment/configuration.md | 42 +++++++++++++--------------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/configure.py b/configure.py index 4e9652b6..17c93653 100755 --- a/configure.py +++ b/configure.py @@ -33,7 +33,7 @@ domain = str(input(f"Enter your domain ({domain}): ") or domain) os.system(f"./scripts/replace-domain {domain}") # change hardware info -os.system(f"{editor} 'metal/inventories/prod.yml'") +os.system(f"{editor} 'metal/inventories/prod.yml'") # TODO use var for inventory # TODO change Terraform workspace diff --git a/docs/src/deployment/configuration.md b/docs/src/deployment/configuration.md index f36a37a1..18ce25b0 100644 --- a/docs/src/deployment/configuration.md +++ b/docs/src/deployment/configuration.md @@ -2,39 +2,37 @@ ## Fork this repository -Because this repository applies GitOps practices, this git repository is the source of truth for my homelab, so you'll need to folk it to make it yours. +Because this repository ([khuedoan/homelab](https://github.com/khuedoan/homelab)) applies GitOps practices, +it's the source of truth for my homelab, so you'll need to folk it to make it yours. -After forking it, clone and replace the reference to my repository with yours (without `https://`): +## Run the configure script + +Run the following script to configure the homelab: ```sh -./scripts/replace-gitops-repo "github.com/yourname/homelab" +./configure.py ``` -Then commit and push the changes. +Example input: -## Server list and hardware info + -Edit the following file and replace the hardware information with the one on your servers: +``` +$ ./configure.py +Text editor (nvim): +Enter seed repo (github.com/khuedoan/homelab): github.com/example/homelab +Enter your domain (khuedoan.com): example.com +``` -> Use `dev.yml` instead of `prod.yml` if you're trying out the dev VM +It will prompt you to edit the inventory, for example: + +> - The IP addresses are the desired ones, not the current one, since your servers have no operating system installed yet. +> - Disk: based on `/dev/$DISK`, in my case it's `sda`, but yours can be `sdb`, `nvme0n1`... +> - Network interface: usually it's `eth0`, mine is `eno1` ```yaml # metal/inventories/prod.yml {{#include ../../../metal/inventories/prod.yml:3:}} ``` -- The IP addresses are the desired ones, not the current one, since your servers have no operating system installed yet. -- Disk: based on `/dev/$DISK`, in my case it's `sda`, but yours can be `sdb`, `nvme0n1`... -- Network interface: usually it's `eth0`, mine is `eno1` - -## Update Ingresses to point to your domain - -> Use [`home.arpa`](https://datatracker.ietf.org/doc/html/rfc8375) if you don't have a domain - -My domain is `khuedoan.com`, run the following command to replace it with yours: - -```sh -./scripts/replace-domain "yourdomain.com" -``` - -Commit and push the changes. +At the end it will show what has changed. After examining the diff, commit and push the changes.