Revert "refactor(metal): put hardware info in inventory too"

This reverts commit 3a72a6d468.
This commit is contained in:
Khue Doan 2022-01-15 10:37:22 +07:00
parent 227439bb61
commit 3e01b44b0f
3 changed files with 23 additions and 8 deletions

View File

@ -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`

View File

@ -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"

View File

@ -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'}