From 3e01b44b0f9aac6d4df18e360acfba4bbc4cc13f Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Sat, 15 Jan 2022 10:37:22 +0700 Subject: [PATCH] Revert "refactor(metal): put hardware info in inventory too" This reverts commit 3a72a6d468b8f6e4675752cda02307d327026584. --- docs/src/deployment/configuration.md | 19 +++++++++++++++---- metal/group_vars/all.yml | 4 ++++ metal/inventories/prod.yml | 8 ++++---- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/docs/src/deployment/configuration.md b/docs/src/deployment/configuration.md index f36a37a1..681e0485 100644 --- a/docs/src/deployment/configuration.md +++ b/docs/src/deployment/configuration.md @@ -7,14 +7,15 @@ Because this repository applies GitOps practices, this git repository is the sou After forking it, clone and replace the reference to my repository with yours (without `https://`): ```sh -./scripts/replace-gitops-repo "github.com/yourname/homelab" +./scripts/replace-gitops-repo "gitservicelikegithub.com/yourname/homelab" ``` Then commit and push the changes. -## Server list and hardware info +## Server list -Edit the following file and replace the hardware information with the one on your servers: +Edit the following file and replace the MAC addresses with the one on your servers. +The IP addresses are the desired ones, since your servers have no operating system installed yet. > Use `dev.yml` instead of `prod.yml` if you're trying out the dev VM @@ -23,7 +24,17 @@ Edit the following file and replace the hardware information with the one on you {{#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. +## Server hardware info + +> Skip this step if you're trying out the dev VM + +Change the following parameters based on your hardware. + +```yaml +# metal/group_vars/all.yaml +{{#include ../../../metal/group_vars/all.yml:6:}} +``` + - 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` diff --git a/metal/group_vars/all.yml b/metal/group_vars/all.yml index 8828020b..d2187000 100644 --- a/metal/group_vars/all.yml +++ b/metal/group_vars/all.yml @@ -2,3 +2,7 @@ ansible_user: root ansible_ssh_private_key_file: ~/.ssh/id_ed25519 ssh_public_key: "{{lookup('file', '~/.ssh/id_ed25519.pub') }}" dns_server: "8.8.8.8" + +# TODO move this to inventory because we may have a mix of different hardware types +disk: "sda" +network_interface: "eno1" diff --git a/metal/inventories/prod.yml b/metal/inventories/prod.yml index 7f6474ab..3a37c7b7 100644 --- a/metal/inventories/prod.yml +++ b/metal/inventories/prod.yml @@ -2,9 +2,9 @@ metal: children: masters: hosts: - metal0: {ansible_host: 192.168.1.110, mac: '00:23:24:d1:f3:f0', disk: sda, network_interface: eno1} - metal1: {ansible_host: 192.168.1.111, mac: '00:23:24:d1:f4:d6', disk: sda, network_interface: eno1} - metal2: {ansible_host: 192.168.1.112, mac: '00:23:24:e7:04:60', disk: sda, network_interface: eno1} + metal0: {ansible_host: 192.168.1.110, mac: '00:23:24:d1:f3:f0'} + metal1: {ansible_host: 192.168.1.111, mac: '00:23:24:d1:f4:d6'} + metal2: {ansible_host: 192.168.1.112, mac: '00:23:24:e7:04:60'} workers: hosts: - metal3: {ansible_host: 192.168.1.113, mac: '00:23:24:d1:f5:69', disk: sda, network_interface: eno1} + metal3: {ansible_host: 192.168.1.113, mac: '00:23:24:d1:f5:69'}